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
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.zipDeclares 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
- Upload the
block-usage-finderfolder to the/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- Navigate to Tools > Block Usage Finder to start searching
Usage
- Go to Tools > Block Usage Finder in your WordPress admin panel
- Select a block from the dropdown menu (all available Gutenberg blocks will be listed)
- Click Search Block Usage
- 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_contentfor 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