A WordPress plugin to search any string across posts, pages, and custom post types — including custom fields, Elementor data, and page templates — preview matches in a sortable table, and export to CSV.
Built for content audits, domain migrations, and bulk URL tracking on sites where the standard WP search just isn't enough.
- Three match modes
Contains— default LIKE search; matches anywhere in the text.Exact phrase— whole-word match using a POSIX word-boundary REGEXP.Regex— full MySQL REGEXP, validated server-side before running.
- Deep content search — title, content, excerpt, all custom fields (including
_elementor_data,content,_wp_page_template,slide_template), across any selected public post types. - Live preview table — sortable columns, in-place filter, post-type filter, per-row Edit / View links, and post-type badges.
- Chunked AJAX loading — results stream in 50 at a time with a progress bar; large sites no longer hit PHP / web-server timeouts. Cancel any time.
- Client-side CSV export — generated from the loaded preview, so exporting is instant and never re-queries the database. Includes a UTF-8 BOM for clean Excel rendering.
- Clean admin UI — no shadows, no gradients, custom select arrow, SVG sort indicators.
- Download the latest release zip.
- In WordPress, go to Plugins → Add New → Upload Plugin and upload the zip.
- Activate the plugin.
git clone https://github.com/wolfdevsllc/wd-export-by-search.git \
wp-content/plugins/wd-export-by-searchActivate WD Export by Search in the Plugins screen.
Go to Tools → Export by Search.
- Enter a search string.
- Pick a match mode:
Containsfor substring matching (e.g.old-domain.com).Exact phrasefor whole-word matching (e.g.officewon't matchofficer).Regexfor MySQL REGEXP patterns (e.g.^https?://(old|legacy)\.).
- Select one or more post types to search.
- Click Search. Results stream into the table with a progress indicator; click Cancel to abort.
- Sort, filter, or refine with the post-type dropdown, then click Export CSV to download.
The CSV columns are Post Title, Post Type, Post URL.
| Mode | SQL behavior | Example | Notes |
|---|---|---|---|
| Contains | LIKE '%term%' |
office matches "head office", "officer", "office space" |
Fastest. Indexed-friendly on small fields. |
| Exact phrase | REGEXP '(^|[^[:alnum:]_])term($|[^[:alnum:]_])' |
office matches "head office", but not "officer" |
Uses POSIX classes — works on MySQL 5.7, 8.x, and MariaDB. |
| Regex | REGEXP '<pattern>' |
^https?://(old|legacy)\. |
Pattern is validated against SELECT '' REGEXP %s before the main query — invalid patterns return a clean error. |
Performance note: Regex on large
wp_postmetatables can be slow because indexes aren't usable. PreferContainsorExact phrasewhen possible.
- Search. A custom AJAX endpoint (
wp_ajax_wdes_search_posts) runsWP_Querywith two extra hooks:posts_search— overridden to useREGEXPwhenmatch_modeisexactorregex.posts_where— adds anEXISTSsubquery againstwp_postmetaso the search reaches custom fields and Elementor data, while excluding hidden meta keys (_underscore_*) other than the known builders.
- Pagination. Each request returns 50 results plus
total,total_pages, anddone. The frontend loops withawait+AbortController, accumulating results into the table. - Export. CSV is built in JavaScript from the already-fetched results — no second round-trip and no server-side timeout risk on the export step.
All AJAX calls are protected by check_ajax_referer and current_user_can('manage_options').
- WordPress 5.0+
- PHP 7.2+
- MySQL 5.7+ or MariaDB 10.0.5+ (for
REGEXPmodes)
The plugin is small enough to need no build step:
wd-export-by-search/
├── wd-export-by-search.php # Plugin bootstrap, AJAX endpoints, query filters
├── admin.js # React (wp.element) admin UI
├── admin.css # Admin styles
└── readme.txt # WordPress.org plugin readme
JS uses wp.element (React) and is loaded as a module-free script via wp_enqueue_script. There's no bundler — edit admin.js and reload.
To package a release:
zip -r wd-export-by-search.zip . -x ".git/*" ".git" "README.md"- Match modes: Contains, Exact phrase, Regex
- Sortable, filterable results preview table with per-row Edit / View links
- Chunked AJAX search with progress bar and cancel
- Server-side regex validation
- Client-side CSV export with UTF-8 BOM
- Refreshed admin UI
- Initial release.
GPL-2.0-or-later. See LICENSE.
Built by WolfDevs.