Search and Replace Text Across a WordPress Site
Search and Replace changes a piece of text everywhere it appears in your site's database in one pass. It is ideal after a migration, when switching to HTTPS, or when a phone number, email, or link has changed on many pages.
Typical uses
- Updating an old domain to a new one after moving a site.
- Changing http links to https.
- Fixing a business email address or URL repeated throughout content.
Safer workflow
- Create a backup first, or confirm a recent one exists.
- If possible, try the change in Staging before doing it on Live.
- Run a search-only pass to see how many matches exist. An unexpectedly large number tells you the search is too broad.
- Make the search more specific and repeat until the count looks right.
- Run the replacement.
Steps
- Go to Sites > WordPress and open the site.
- In Quick actions, choose Search & Replace.
- Enter the Search value, select the Tables to include, and enter the Replace value.
- Click Next and confirm.
- Wait for completion, read the summary, and spot-check several pages.
How matching works
- Matching is case-sensitive, so enter text exactly as stored.
- Text is matched literally. Wildcards and regular expressions are not supported.
- You cannot limit by individual page, so control scope with a specific search value.
- Do not target passwords or system settings.
- Multisite networks must be handled one site at a time.
Undoing a mistake
There is no undo button. To reverse a replacement, restore the backup taken before you started. Activity and audit logs show who performed administrative actions.
Good to know: Include enough surrounding characters, such as the full domain with its slashes, to avoid replacing unrelated text.
Was this article helpful?
