Find which pages and posts use GenerateBlocks blocks

How can I find which pages and posts use GenerateBlocks blocks?

Preferably with a search in Wordpress or in phpMySQL.

This is because I’ll be transferring content from one site to another regularly and don’t want to end up with parts not displaying correctly because I or someone else happened to use a GB block instead of a standard WP block.

So, I want to remove GB from the source site (as the target won’t use it). Manually checking all pages and posts is tedious and error prone, so I’d like a way to do it with a search.


Thanks, Marjan

@marjanvenema you can run the following SQL command to check the ids and post name (slug) of all pages/posts using GB blocks.

SELECT ID, post_name FROM wp_posts WHERE post_content LIKE '%wp:generateblocks%' AND post_type <> 'revision';
1 Like

Thanks, @JeanPaiva , much appreciated! Might have found the “LIKE” bit, but excluding the revisions would not have occurred to me, let alone how to do it.