WP Manifestindependent plugin directory
manifest / developer / block-usage-finder

Block Usage Finder

A WordPress plugin that allows you to search and find where specific Gutenberg blocks are used across your WordPress site with detailed usage statistics.

by Dmitry Shutko · github.com/shoot56/block-usage-finder · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/shoot56/block-usage-finder/archive/refs/heads/main.zip

Declares an update source (shoot56/block-usage-finder), so updates arrive through the plugin's own updater.

Readme

Block Usage Finder

A WordPress plugin that allows you to search and find where specific Gutenberg blocks are used across your WordPress site with detailed usage statistics and advanced filtering options.

Features

  • Block Search: Search for any Gutenberg block (core or custom) across all your content
  • Custom Post Types Support: Searches in all public post types including WooCommerce Products, Portfolio, etc.
  • Post Type Filtering: Choose specific post types to search in with visual checkboxes
  • Detailed Statistics: View comprehensive usage statistics including:
    • Total number of posts/pages using the block
    • Total occurrences across all content
    • Most frequently used location
    • Number of posts scanned
  • User-Friendly Interface: Clean admin interface under Tools menu with modern design
  • Comprehensive Results: View detailed information about each post/page including:
    • Post title with edit link
    • Post type (with proper labels)
    • Publication date
    • Number of block occurrences
    • Quick edit and view actions
  • Performance Optimized: Caching, memory management, and query optimization
  • Security Hardened: SQL injection protection, input validation, and capability checks

Installation

  1. Upload the block-usage-finder folder to the /wp-content/plugins/ directory
  2. Activate the plugin through the 'Plugins' menu in WordPress
  3. Navigate to Tools > Block Usage Finder to start searching

Usage

  1. Go to Tools > Block Usage Finder in your WordPress admin panel
  2. Select a block from the dropdown menu (all available Gutenberg blocks will be listed)
  3. Click Search Block Usage
  4. View the results:
    • Usage Statistics: Summary cards showing total usage and most used location
    • Detailed Results: Table with all posts/pages using the selected block

Requirements

  • WordPress 5.0 or higher (Gutenberg editor)
  • PHP 7.2 or higher

How It Works

The plugin scans all published posts and pages in your WordPress installation to find instances of the selected block. It uses WordPress's built-in parse_blocks() function to properly parse block content, including nested blocks.

Block Detection

  • Scans post_content for Gutenberg block markers
  • Supports core WordPress blocks (paragraph, heading, image, etc.)
  • Supports custom and third-party blocks
  • Correctly handles nested blocks

Performance

  • Queries only published posts and pages
  • Uses WordPress core functions for optimal performance
  • Caches block list for better performance

Frequently Asked Questions

What types of blocks can I search for?

You can search for any Gutenberg block that is registered in your WordPress installation, including:

  • Core WordPress blocks (core/paragraph, core/heading, core/image, etc.)
  • Custom blocks from your theme
  • Third-party plugin blocks

Does it work with nested blocks?

Yes! The plugin uses recursive parsing to find blocks nested within other blocks (like columns, groups, etc.).

Can I search for ACF blocks?

Currently, the plugin is optimized for Gutenberg blocks. ACF blocks may appear in the list if they are properly registered as Gutenberg blocks.

Does it affect my site's performance?

The plugin only runs when you use the search feature in the admin panel. It does not affect your front-end site performance at all.

Support

For issues, questions, or contributions, please visit the plugin repository or contact the developer.

License

This plugin is licensed under the GPL v2 or later.

What's New

Version 1.2.0

  • Post Type Filtering - Choose which post types to search with checkboxes
  • 🎨 Visual post type selector with post counts
  • 📊 "Select All" functionality for quick selection
  • 💡 Shows which post types were searched in results

Version 1.1.0

  • Custom Post Types Support - Now searches ALL public post types
  • ⚡ Performance improvements with caching (24h)
  • 🔒 Enhanced security with SQL injection protection
  • 🚀 Query optimization and memory management
  • 📈 Scanned posts counter

Version 1.0.0

  • Initial release
  • Block search functionality
  • Usage statistics
  • Admin interface
  • Support for all Gutenberg blocks

Read the full README on GitHub →