Find pages with blocks your site no longer has

ContentIntermediate~10 min

Before you start

Plugin version 1.10.0 or newer, which adds List block types. It and the page and post reads are off until you switch them on. The connected user needs the edit-posts capability, and edit access to the pages for raw markup. Nothing here writes.

Deactivating a plugin takes one click. The blocks it added stay behind in every page that used them, a pricing table here and a slider there, and nothing tells you which pages they are on.

The agent compares the block names your pages use with the ones the site still has registered, nested blocks included, and records an exact path for each leftover so a later swap can address it precisely.

The prompt
I removed [the old slider plugin] and want to find blocks it left behind.
Read only: change nothing.
1. List every block type registered on this site and keep the full list of
names. Page until you have all of them.
2. Read every published page as raw block markup, 10 at a time, and tell
me how many you have read out of the total as you go. [Do the same for
published posts.]
3. From each item's markup, collect every block name from the block
comments, including blocks inside groups, columns and covers. A name
with no slash is core/<name>. Record each block's path: its position
among the top-level blocks, then its position inside each parent.
Blank lines between blocks do not count.
4. Any name not in the registered list is a likely leftover, not proof:
blocks registered only in JavaScript are not in that list.
Give me a table grouped by block name: title, ID, path, and the first line
of text inside the block. Then a count per block name, and ask me which
names really are leftovers.

Why this is safe to run

The block type list is what the editor already knows, and the page and post reads return markup the connected user can already edit. Nothing is saved.

Each path points at one block, nested or not. When you replace a leftover, replace a leftover block with a core block uses that path and checks the block name before it writes.

Already connected? Ask your agent to find blocks your site no longer has, and name the plugin you removed so it can group the results.

How it works

  1. List every block type registered on the site.
  2. Read published pages, and posts if you want them, as raw block markup, 10 at a time.
  3. Compare every block name, nested ones included, with the registered list.
  4. Report likely leftovers by page, path and the text inside them.

Questions

Why do leftover blocks matter?
When the plugin that registered a block is gone, the editor cannot show that block as itself. Visitors may see its saved HTML or nothing useful, and editors get a block the editor cannot handle.
Is every block on the list really a leftover?
Not always. List block types shows blocks registered on the server. A block registered only in JavaScript is missing from that list but still works, so the prompt calls these likely leftovers and asks you to confirm.
Does this catch shortcodes from old plugins too?
No. It compares block names with registered block types. A shortcode is plain text inside a block; a content search for the shortcode name finds those.