• Is there a tool to find where a synced pattern is used? I like to use synced patterns for boilerplate text, but if I need to change one, I need to be able to find where I have used that pattern to make sure it works in all locations.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @bobstayton

    I’m not aware of any tool that does this, but if you have access to your database, you could run a SQL query on the posts table to search the post_content field for your synced block.

    The first step would be to get the code for the synced block. So for example created a synced block in a post with some text and an image, then I switched to the code editor view and the code for the synced block looked something like this

    <!-- wp:block {"ref":77} /-->

    Then, in my database tool (I use phpmyadmin) I can run the following query on the wp_posts table

    SELECT * FROM wp_posts WHERE post_content LIKE '%<!-- wp:block {\"ref\":77} /-->%'

    Note the backslashes before the ” characters, this is required to escape the quotes.

    This query returns a result of all the records (posts, pages, templates) that include the synced pattern code.

    I asked myself the same question. Wouldn’t it be nice to see it somewhere in WP? Maybe at least on the Patterns Overview Page:

    /wp-admin/edit.php?post_type=wp_block

    Would be very nice to see easely where synced patterns are used :)!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘find where synced pattern is used’ is closed to new replies.