Fix "This block contains unexpected or invalid content"
When the editor shows This block contains unexpected or invalid content., the block's saved content no longer matches what the block expects. It usually happens after a plugin or theme update, after editing the block's HTML by hand, or after pasting from Word or Google Docs.
Your live page keeps showing the last good version until you delete the block, so don't delete it yet.
Attempt Recovery
- Open the page in the editor.
- Find the block showing the error.
- Click Attempt Recovery (older WordPress versions say Attempt Block Recovery).
WordPress rebuilds the block from its saved content. If it looks right, click Update.
If several blocks break after a big theme or plugin update, recover them one at a time. List View makes it easier to find blocks nested inside layouts.
If Attempt Recovery isn't there
Badly damaged blocks sometimes don't offer recovery. The live page still shows the old version as long as the block stays in place.
- Open the live page in another tab to use as a reference.
- Add a new block of the same type and rebuild the content.
- Once the new block matches, delete the broken one.
- Click Update.
Convert to HTML
The block's โฎ menu may offer Convert to HTML. Only use it if you're comfortable editing raw HTML. You can't convert it back, and if the HTML version doesn't work out you'll still have to rebuild the block.
To avoid this error, don't paste straight from Word or Google Docs. Paste into a plain-text editor first, then copy from there.