mcp_search_replace
Search and replace a string in text columns across a WordPress site's prefixed tables; use the default dry run to count matches before writing changes.
Instructions
Search and replace a string in every text column of the site's tables (current table prefix only). Plain SQL REPLACE: it is NOT serialization-safe, so a replacement of different length corrupts serialized PHP values (options, postmeta, widgets). Both strings pass through sanitize_text_field on the server (tags and line breaks are stripped). total_changes and tables count matching rows per column, not occurrences.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site": "<site>",
"search": "<search>",
"replace": "<replace>"
},
"name": "mcp_search_replace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| site | Yes | Site id (see list_sites) | |
| search | Yes | String to search for | |
| tables | No | Full table names to limit the run to (must start with the table prefix; empty or omitted = all prefixed tables) | |
| dry_run | No | Only count matches without writing (default true) | |
| replace | Yes | Replacement string |