# Search & Replace
Run a database-wide search and replace (useful after domain or URL changes).
Requires the WordPress Toolkit add-on.
Base path: .../wordpress-toolkit
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/search-replace
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| search | Yes | String | Text to find in the database |
| replace | Yes | String | Replacement text |
| dry_run | No | String | "true" to preview changes without writing; "false" to apply |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/search-replace" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{
"search": "https://old-domain.com",
"replace": "https://new-domain.com",
"dry_run": "true"
}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"message": "Search and replace dry run completed, no changes applied",
"results": [
{
"table": "wp_commentmeta",
"column": "meta_key",
"replacements": 0,
"type": "SQL"
},
{
"table": "wp_users",
"column": "display_name",
"replacements": 0,
"type": "SQL"
}
],
"status": "success",
"summary": "Success: 0 replacements to be made."
}
}
# Validation Error
- 422 (Unprocessable Entity)
# Server Error
- 500 (Internal Server Error)