Problem with updating widgets
Description
The Gutenberg editor on the widgets page is not working properly. When adding a linebreak inside an existing paragraph (in the middle, not at the end) the update button will get stuck loading.
Step-by-step reproduction instructions
- Go to playground.wordpress.net, enable network access, activate a theme that supports widgets (e.g. Twenty Twenty)
- Go to the widgets editor by clicking on appearance -> widgets
- Add a long
paragraphwith multiple sentences of text - Click save
- Edit the widget by adding a linebreak somewhere inside the paragraph you wrote in step 3
- Click save
Screenshots, screen recording, code snippet
https://github.com/user-attachments/assets/c1433a72-1caf-41e1-a9c9-36fe92f8a63a
Environment info
WordPress 6.7.2, no other plugin installed, no Gutenberg plugin installed.
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [ ] Block
- [ ] Classic
- [x] Hybrid (e.g. classic with theme.json)
- [ ] Not sure
Hi @JelleTempelman, Thank you for reporting the issue. I was able to reproduce the bug when saving the widget.
It seems to be related to how the Widgets Editor handles content serialization when saving the content of innerblocks.
I’ll investigate further to identify the root cause and possible fixes. I’ll update this thread once I have more insights. 🙌🏻
export const __experimentalBatch =
( requests ) =>
async ( { dispatch } ) => {
const batch = createBatch();
const api = {
saveEntityRecord( kind, name, record, options ) {
return batch.add( ( add ) =>
dispatch.saveEntityRecord( kind, name, record, {
...options,
__unstableFetch: add,
} )
);
},
saveEditedEntityRecord( kind, name, recordId, options ) {
return batch.add( ( add ) =>
dispatch.saveEditedEntityRecord( kind, name, recordId, {
...options,
__unstableFetch: add,
} )
);
},
deleteEntityRecord( kind, name, recordId, query, options ) {
return batch.add( ( add ) =>
dispatch.deleteEntityRecord( kind, name, recordId, query, {
...options,
__unstableFetch: add,
} )
);
},
};
const resultPromises = requests.map( ( request ) => request( api ) );
console.log( "resultPromises", resultPromises );
const [ , ...results ] = await Promise.all( [
batch.run(),
...resultPromises,
] );
console.log( "results", results );
return results;
};
Following code is not correctly saving. Promises are not getting fullfilled in this case.
@JelleTempelman Thank you for reporting the issue.
After further investigation, I found that this issue occurs only when the paragraph is added directly to the widget. If the paragraph is placed inside a Group block or another container, the issue does not persist.
To provide more clarity, I have attached a video demonstrating this behavior:
https://github.com/user-attachments/assets/66cf75b3-16ae-459a-9da0-1546e788e389
cc: @Mamaduka
Combined Bug Reproduction and Patch Test Report
Description
✅ This report validates that the indicated patch works as expected.
Patch tested: https://github.com/WordPress/gutenberg/pull/69704
Environment
- WordPress: 6.8-beta3-60061
- PHP: 8.2.28
- Server: Apache/2.4.62 (Debian)
- Database: mysqli (Server: 11.4.5-MariaDB-ubu2404 / Client: mysqlnd 8.2.28)
- Browser: Chrome 134.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty 2.8
- MU Plugins:
- Gutenberg Test Plugin, Disable Login Autofocus
- Gutenberg Test Plugin, Disable Remote Patterns
- Gutenberg Test Plugin, Enable Templates UI
- Gutenberg Test Plugin, No-cache Headers
- Gutenberg Test Plugin, Normalize Theme
- server-timing.php
- Plugins:
- Gutenberg 20.5.0
- Test Reports 1.2.0
Minimal Bug Reproduction
- Go to the Appearance > Widgets Area with a Theme with Widgets (like Twenty Twenty).
- Insert a paragraph inside a Group in the widgets area and add "A" in text ⇾ Save post
- Then add a new paragraph outside the group and some text "AB" ⇾ Save post
- Now split the "AB" with a newline between A and B (enter) adding another paragraph with just the B ⇾ Save post
It will end something like this:

- 🐞Bug Reproduced ⇾ Saving gets stuck
Expected Results
- Saving is never stuck
Actual Results with Patch
- ✅ Issue is resolved with the patch.
Additional Notes
This bug is moderately challenging to reproduce, I could not reproduce it with @JelleTempelman video, but with the @snehapatil2001 I could for being able to test the patch more consistently. From there, I've been trying to create a minimal report without many steps.
It would be nice to retest the same issue with other blocks that support splitting - Button, List Item, Heading.
Thanks for the suggestion, @Mamaduka. I have tested the issue with Button, List Item, and Heading blocks, and the behaviour remains consistent.
Thank you, @snehapatil2001!
What do you mean by consistent? Does the same bug affect those blocks, or is it only limited to the Paragraph block?
@Mamaduka Apologies for the confusion! To clarify:
- Paragraph block was the only one exhibiting the hanging-save bug.
- Other blocks (Heading/List Item/Button) were tested to confirm they don’t share the issue—all saved correctly when split.
It would be nice to retest the same issue with other blocks that support splitting - Button, List Item, Heading.
@Mamaduka make sense on the paper, but it took me longer than usual to minimally reproduce this bug. But I've noticed a big difference between paragraph and other "splittable" elements: When you split them, the splitted element defaults to paragraph (i.e. heading) OR splits into the same element (i.e list).
Anyway, today I cannot reproduce it the same I could yesterday.
According to @snehapatil2001 has detected that the problem is caused a block ID duplication on split? What I can't understand is why this duplication is caused after having to do multiple stunts on the editor. It's not like, you split a paragraph = you get the error.
My question is: what is exactly triggering it?
My question is: what is exactly triggering it?
@SirLouen, that what we're trying to figure out and resolve.
Hey @Mamaduka @SirLouen,
After a thorough investigation, I was able to find out why paragraph splits fail in widget areas, why paragraph blocks only do not get unique IDs and why other block splits work correctly while paragraphs doesn't, and I have made changes to PR accordingly.
Paragraphs don't trigger special cases:
- No transformation ( like heading )
- No structural child creation ( like button or list )
So in paragraph case, duplication of the block with all attributes ( including __internalWidgetId, due to which the saving fails as widget area cannot have two blocks with same id ).
Root Cause:
The split logic in __unstableSplitSelection copied all attributes when:
- Creating the "tail" block during splits
- No block type transformation occurred (e.g., paragraphs splitting into paragraphs)
How Splitting Logic Works :
1. Paragraph Blocks
When you press Enter in a paragraph:
- The code detects it's splitting the same block type (blockA.name === blockB.name)
- Creates a new block (the "tail") with: ✓A fresh clientId (normal behavior) ✓ All original attributes except __internalWidgetId (set to undefined)
- Why this works: Prevents duplicate widget IDs while keeping other formatting (like bold text)
2. Heading Blocks
When you press Enter in a heading:
- The code converts it to a paragraph (through switchToBlockType)
- Generates a completely new block with: ✓ New clientId ✓ New attributes (no inherited widget ID)
- Key difference: The block type change triggers fresh attribute generation
3. List/Button Blocks
When you press Enter in lists or buttons:
- Creates structural children (like list-item or button blocks)
- These children are designed to: ✓ Inherit only specific attributes ✓ Skip widget IDs entirely
- Built-in safeguard: Child blocks never get __internalWidgetId
@snehapatil2001 but why it's affect when you simply split on a Post? Have you found why is this linked to the widgets section?
@SirLouen This only affects widget areas because they use __internalWidgetId to sync with WordPress' legacy widget system, which enforces unique IDs. The post editor doesn’t rely on this ID check, so splits work fine there.
I could not reproduce again this bug this morning, because I forgot to refresh ths JS build
But why this is not being triggered on first split?
https://github.com/user-attachments/assets/2c506a7f-f370-4eb6-857d-74dff6460762
I can still replicate this with WordPress 7.1.2 and Gutenberg 24.0.