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

  1. Create a backup first, or confirm a recent one exists.
  2. If possible, try the change in Staging before doing it on Live.
  3. Run a search-only pass to see how many matches exist. An unexpectedly large number tells you the search is too broad.
  4. Make the search more specific and repeat until the count looks right.
  5. Run the replacement.

Steps

  1. Go to Sites > WordPress and open the site.
  2. In Quick actions, choose Search & Replace.
  3. Enter the Search value, select the Tables to include, and enter the Replace value.
  4. Click Next and confirm.
  5. 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?