How to find what pages/posts contain a particular reusable block?

How can I find out what pages and post on a site contain a particular reusable block?

Typically, to find content on a site, I issue wp db search *itemlookingfor* (like the post ID, part of a file name, or a word)

OR

wp db query 'SELECT ID FROM the_posts_table WHERE post_content LIKE %itemlookingfor% AND post_status=publish'

In my case, I used the reusable block's ID and no results were returned for either command. I replaced the ID of the reusable block with other common words on my site and results were returned so I think it's something special with reusable blocks.

Ideally, I'd like to use a wp-cli command or failing that, a sql command to search my database.

Topic wp-cli Wordpress

Category Web


Those commands do work now after I stepped away for a few hours from the problem; so it was something on my end.

In my examples in the question, You can substitute the reusable block's post_id with the itemlookingfor to obtain the pages that contain your reusable block.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.