Title: Find Blocks, Patterns &amp; Shortcodes
Author: matthewneilcowan
Published: <strong>2025 年 12 月 25 日</strong>
Last modified: 2026 年 4 月 23 日

---

搜索插件

![](https://ps.w.org/find-blocks-patterns-shortcodes/assets/banner-772-250.png?rev
=3427439)

![](https://ps.w.org/find-blocks-patterns-shortcodes/assets/icon.svg?rev=3441062)

# Find Blocks, Patterns & Shortcodes

 作者：[matthewneilcowan](https://profiles.wordpress.org/matthewneilcowan/)

[下载](https://downloads.wordpress.org/plugin/find-blocks-patterns-shortcodes.1.1.1.zip)

 * [详情](https://cn.wordpress.org/plugins/find-blocks-patterns-shortcodes/#description)
 * [评价](https://cn.wordpress.org/plugins/find-blocks-patterns-shortcodes/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/find-blocks-patterns-shortcodes/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/find-blocks-patterns-shortcodes/#developers)

 [支持](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/)

## 描述

Find Blocks, Patterns & Shortcodes locates content containing specific Gutenberg
blocks (including options to search by CSS class and HTML anchor attributes), patterns,
and shortcodes, with a CSV export feature perfect for audits & analysis.

#### Core Features

 * **Progressive search** with batch processing for large sites
 * **Post type filtering** – search across posts, pages, or custom post types to
   find blocks, patterns, and shortcodes
 * **CSV export** – export results for reporting, auditing, and analysis
 * **Block dropdown** – select from all registered blocks
 * **Attribute search** – find blocks by CSS class and HTML anchor attributes
 * **Synced pattern search** – find usage of reusable blocks/patterns
 * **Sortable results tables** for easy analysis
 * **WP-CLI support** for automation

#### Performance Optimized

 * Smart caching with 5-minute TTL
 * Batch processing (100 posts per batch)
 * Query optimization (IDs only fetch)
 * Progress indicators for long operations
 * Cancellable searches
 * Hard limit protection (500-1000 posts)

#### Security

 * Enhanced input validation with blacklisting
 * Dual-layer rate limiting (user + IP)
 * Timeout protection (25-second safeguard)
 * Information disclosure prevention
 * XSS and injection prevention
 * Nonce auto-refresh for long sessions

#### Accessibility

 * Screen reader compatible with ARIA live regions
 * Full keyboard navigation support
 * Visible focus indicators
 * Form labels for all inputs
 * Results count announcements
 * Responsive design with 200% zoom support

### WP-CLI Commands

Search for blocks:
 wp block-usage search core/paragraph –post-type=post,page –format
=table

Clear cache:
 wp block-usage clear-cache

View security logs:
 wp block-usage logs –limit=100 –format=csv

### Filters and Hooks

#### Filters

 * `fbps_query_limit` – Adjust search limit (default: 500, max: 1000)
 * `fbps_enable_security_logging` – Toggle security logging (default: true)
 * `fbps_allow_editor_access` – Allow Editor role access (default: false)

#### Actions

 * `fbps_security_event` – Hook into security event logging

### Privacy

This plugin:
 * Does not collect any user data * Does not make external API calls*
Stores security logs locally (last 1000 events) * Logs include: timestamp, user 
ID, IP address, event type * Security logs can be disabled via filter

### Support

For support, feature requests, or bug reports, please use the WordPress.org support
forums.

### Credits

Developed by Matthew Cowan

## 屏幕截图

 * [[
 * Main search interface with block dropdown and post type selection
 * [[
 * Search results table with sortable columns and export csv button

## 安装

 1. Upload the plugin files to `/wp-content/plugins/find-blocks-patterns-shortcodes/`
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Navigate to Tools > Find Blocks, Patterns & Shortcodes
 4. Start searching for blocks!

## 常见问题

### What block name format should I use?

Block names follow the format `namespace/block-name`. Examples:
 * `core/paragraph`*`
core/image` * `woocommerce/product-price`

### Can I search custom blocks?

Yes! The plugin works with any registered Gutenberg block, including custom blocks
from themes and plugins.

### How do I allow Editors to use this plugin?

Add this filter to your theme’s functions.php:
 add_filter(‘fbps_allow_editor_access’,‘
__return_true’);

### Can I export the results?

Yes! Click the “Export CSV” button after searching to download results as a spreadsheet.

### Does it work with WP-CLI?

Yes! Use `wp block-usage search core/paragraph` for command-line searches.

### How do I search for synced patterns?

Use the “Search for Synced Pattern Usage” section to find where reusable blocks/
patterns are used.

## 评价

![](https://secure.gravatar.com/avatar/8006731d7ac58d1b431a0f826fa2ae72ca8552043e1e46ac7220d89ed5716c3b?
s=60&d=retro&r=g)

### 󠀁[Works great for finding Blocks!](https://wordpress.org/support/topic/works-great-for-finding-blocks/)󠁿

 [swinggraphics](https://profiles.wordpress.org/swinggraphics/) 2026 年 4 月 23 
日 1 回复

I have only tested the basic block search functionality, but that works great! Good
options; I can imagine the class search, etc, being very helpful.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/)

## 贡献者及开发者

「Find Blocks, Patterns & Shortcodes」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ matthewneilcowan ](https://profiles.wordpress.org/matthewneilcowan/)

[帮助将「Find Blocks, Patterns & Shortcodes」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/find-blocks-patterns-shortcodes)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/find-blocks-patterns-shortcodes/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/find-blocks-patterns-shortcodes/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/find-blocks-patterns-shortcodes/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/find-blocks-patterns-shortcodes/)。

## 更新日志

#### 1.1.1

 * Fixed Edit links in search results not opening the post editor (URLs were double-
   HTML-encoded, leaving a literal `&#038;` in the query string so `action=edit`
   was never parsed)
 * Edit links now open in a new tab, matching the View link behavior, so search 
   results are preserved

#### 1.1.0

 * Added CSS class and HTML anchor search for block attributes
 * Search by class/anchor alone or combined with block name
 * Added configurable result table columns (Title, Type, Date shown by default; 
   CSS Class and HTML Anchor optional)
 * Column visibility toggles re-render results in real-time
 * CSV export respects visible column selection
 * Improved sorting arrow UX with larger Unicode indicators and hover states
 * Refactored display functions to shared table builder for consistency

#### 1.0.3

 * Properly include assets (fixed version number)

#### 1.0.2

 * Properly include assets

#### 1.0.1

 * Refactored asset loading to use WordPress enqueue standards (wp_enqueue_style/
   wp_enqueue_script)
 * Extracted inline CSS to separate file (assets/css/admin.css)
 * Extracted inline JavaScript to separate file (assets/js/admin.js)
 * Added version constant for consistent cache busting
 * Improved code maintainability and browser caching
 * Added translator comments for i18n best practices
 * WordPress Plugin Review compliant

#### 1.0.0

 * Initial release
 * Basic block search functionality
 * Added progressive batch search for large sites
 * Added post type filtering
 * Added CSV export functionality
 * Added synced pattern search
 * Added WP-CLI support
 * Added smart caching (5-minute TTL)
 * Added cancel search functionality
 * Added sortable results tables
 * Enhanced security with IP-based rate limiting
 * Performance optimizations

## 额外信息

 *  版本 **1.1.1**
 *  最后更新：**3 周前**
 *  活跃安装数量 **不到10**
 *  WordPress 版本 ** 5.0 或更高版本 **
 *  已测试的最高版本为 **6.9.4**
 *  PHP 版本 ** 7.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/find-blocks-patterns-shortcodes/)
 * 标签
 * [admin](https://cn.wordpress.org/plugins/tags/admin/)[blocks](https://cn.wordpress.org/plugins/tags/blocks/)
   [content](https://cn.wordpress.org/plugins/tags/content/)[gutenberg](https://cn.wordpress.org/plugins/tags/gutenberg/)
   [search](https://cn.wordpress.org/plugins/tags/search/)
 *  [高级视图](https://cn.wordpress.org/plugins/find-blocks-patterns-shortcodes/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/reviews/)

## 贡献者

 *   [ matthewneilcowan ](https://profiles.wordpress.org/matthewneilcowan/)

## 支持

最近两个月解决的问题：

     总计 1，已解决 1

 [查看支持论坛](https://wordpress.org/support/plugin/find-blocks-patterns-shortcodes/)