Skip to content

WordPress Gutenberg blocks broken after a core update — recovery

A WordPress core update silently bumps block API versions, breaking blocks that worked yesterday. How to spot the deprecated markup, recover content, and prevent the next round.

A WordPress 6.x point release lands, the editor reloads, and half the posts now show a yellow “This block contains unexpected or invalid content” banner. The block is usually still rendered correctly on the front end — Gutenberg keeps a save HTML snapshot in the post content. What broke is the editor’s ability to parse that snapshot into the current block schema. This is recoverable in almost every case, but only if you understand what Gutenberg is comparing against.

What’s happening

Every block has a save() function that serializes its attributes into HTML, wrapped in HTML comments that look like <!-- wp:paragraph {"align":"center"} -->. When the editor loads a post, it parses those comments and rebuilds the block tree. If the block’s save() output has changed since the post was saved (because the block plugin updated, or core changed how it validates a deprecated attribute), the parser detects the mismatch and shows the validation warning.

Most blocks register a deprecated array in their definition — older versions of the save output that should still parse cleanly. When a core update changes the block API and the plugin author hasn’t added a matching deprecation, the post content stays valid HTML on the front end but the editor refuses to convert it back into a block.

How to verify

wp post list --post_type=post --format=ids | head -50 | while read id; do
  wp post get $id --field=post_content | grep -c "wp:" 
done

wp eval 'echo PHP_EOL . get_option("blocks_changed_in_core_update") . PHP_EOL;'

wp eval-file scripts/find-invalid-blocks.php
tail -f /home/example/public_html/wp-content/debug.log

In the editor itself, open a post showing the warning and click the “Attempt block recovery” button. If recovery succeeds without prompting, the deprecation chain handled it. If it converts the block into a Classic HTML block, the deprecation chain was incomplete.

The fix

  1. Stop publishing until you know the blast radius. Run a WP-CLI script that loops every post and runs parse_blocks( $post->post_content ) then serialize_blocks() on the result. Any post where the round-trip differs is suspect.
  2. Roll back the offending plugin first, not core. If the broken blocks are from a single plugin (Kadence, Spectra, Stackable), pin that plugin to the prior version and update it on a staging clone. Reverting core is heavier and riskier.
  3. Use the block recovery button surgically. On a small number of affected posts, the editor’s “Attempt block recovery” works. On hundreds of posts, write a WP-CLI command that processes them in batches, logs the original block markup, and produces a diff for review.
  4. Fix the broken block in code, not in posts. If you maintain the block, add a deprecated entry that matches the prior save shape and returns the new attributes. Push a plugin update. WordPress will silently upgrade existing posts on next edit.
  5. Set up a staging clone for every core update. A staging environment that mirrors plugins and content takes the surprise out of point releases. enterprise WordPress hosting deployments include automated staging refresh as standard.

When a core update has already broken blocks in production and the editorial team needs help triaging hundreds of posts, Stack Harbor’s enterprise WordPress hosting team triages and rebuilds — start the conversation for incident-grade recovery.