Where are WordPress block plugins being used on my site?

Opened laptop on table of office worker

If you work with WordPress for any length of time, you’ll know that sometimes a plugin you’re using gets abandoned or removed from the repository. When this happens, it’s good to replace it with another, up-to-date plugin.

This happened to me with WP Block Gallery and the site in question happened to use three different block plugins. I needed a quick way to determine which blocks were used on which pages, and wanted to create a system I could use next time this happened, so I did an experiment.

Block Plugins

I chose a variety of block plugins that had been updated recently, a lot of installations and good reviews. I installed these 10 (listed in alphabetical order).

Just a note that there are other block plugins available; this post isn’t about which block plugins are better than others, rather I chose a variety to make the experiment more robust.

After I installed and activated the plugins, I had a colleague add different blocks from different plugins to five test pages that she created.

Database

The answers that we’re looking for are found in the database. There are different ways to access the database depending on your website host. In your Flywheel dashboard, go to Advanced and Manage Database. In cPanel, go to phpMyAdmin. Once you access the database, look for your posts table.

Posts table in phpMyAdmin
Posts table in phpMyAdmin

After reviewing the records in my posts table, I saw that each plugin prefixed their blocks with wp:. Most block plugins used names that were easily recognizable:

  • CoBlocks – wp:coblocks
  • Essential Blocks – wp:essential-blocks
  • Generate Blocks – wp:generateblocks
  • Gutenberg Blocks and Template Library by Otter – wp:themeisle-blocks
  • Gutentor – wp:gutentor
  • Kadence Blocks – wp:kadence
  • PublishPress Blocks – wp:advgb
  • Stackable – wp:stackable or wp:ugb
  • Ultimate Addons for Gutenberg – wp:uagb
  • Ultimate Blocks – wp:ub

The name of the block comes after the block library. For example: wp:themeisle-blocks/advanced-columns, wp:kadence/googlemaps or wp:essential-blocks/social.

SQL

I created the following query for the the posts table. If you want to include custom post types, add those inside the brackets with ('page', 'post').

SELECT post_title, post_type, post_content
FROM wp_posts
WHERE post_type IN ('page', 'post')
AND post_status = 'publish'
AND post_content LIKE '%wp:%';

Search

If you’re not familiar with SQL, use the search function to look for:

  • The title, the type (post, page or your custom post type) and the content
  • From the posts table (make sure to use your database prefix)
  • Where it’s a page, post or your custom post type (not an image or attachment, etc.)
  • And it’s a published page or post (not a revision)
  • And the post content has at least one block

Results

If you’re able to export the results to CSV, it will be easier to navigate the results. Here we can see that on the page named TEST 2, my colleague used:

  • Advanced Columns from ThemeIsle blocks
  • Call to Action, Text and Button Group from Stackable
  • GIF from CoBlocks
CSV results of database query

Now that I’ve identified the blocks and pages, I can swap the blocks out for others and remove the abandoned plugin.

Have questions or comments? Let’s chat on Twitter.

Scroll to Top