Appearance
Find Text across the Site with AI
wp_find_in_site searches posts, custom fields and terms without changing them. It only returns content the connected WordPress user can edit. The connection must allow this tool, and the site's wp_search tool must also be enabled.
In this article
Start a search
Pass queries with 1–10 strings, each no longer than 500 bytes. By default, the tool searches posts, their custom fields and term names and descriptions. Use sources to limit the search to posts, post_meta or terms. Use post_types to narrow the post types whose posts and custom fields are searched.
Matching is case-sensitive by default. Set case_sensitive to false for case-insensitive matching. Set snippets to true when you need text surrounding a match. Revisions are included by default. Attachments are excluded unless you explicitly include them in post_types.
Continue until the scan is complete
A search can stop when it reaches its time or response-size limit. If the reply says complete is false, send its next_cursor back as cursor, keeping the same search arguments. Repeat until complete is true.
The counts in each reply cover only that reply, not the entire scan. Once the scan is complete, add the counts from all replies to report totals. A null count with an incomplete reason does not mean zero results.
Understand what was not searched
Check not_searched to see which content was skipped. This is not a whole-database search: it excludes options, widgets, users, comments, term meta, other tables, keys with secret-like names, and unsupported stored values.
Each result identifies a post, custom field or term, and may include a path within stored data. The tool only finds text; it does not change it. To replace text across the database, use the separate Search and Replace Across the Database guide.