Skip to content

Search & Replace

How to Do Search and Replace in WordPress

Search and replace lets you find an old URL in your WordPress database and swap it for a new one across posts, excerpts, attachments, links, and custom fields in one pass. It is the fastest way to fix a domain change, a migration, an HTTP-to-HTTPS switch, or a CDN provider change. Once you have installed Update URLs, open Update URLS → Search & Replace, enter the old and new values, choose where to update, and run the operation.

What is search and replace in Update URLS?

Update URLS is a WordPress plugin that finds a value in your database and replaces it everywhere it appears, including inside serialized data that a plain SQL query would corrupt. The free version replaces URLs across a fixed set of content targets. The PRO version extends this to any database table, adds a dry-run preview, and lets you undo a run afterward.

The Search & Replace screen is a single form (it is not tabbed). History, Tools, and Settings are separate submenus under the Update URLS menu.

How to run search and replace (free)

In the free version, the Search For and Replace With values are treated as URLs, so this is the tool for URL changes such as moving to a new domain or forcing HTTPS.

  1. Go to Update URLS → Search & Replace.
  2. In Search For, enter the old URL you want to find.
  3. In Replace With, enter the new URL.
  4. Under Where to Update?, tick one or more targets (see the table below).
  5. Optionally tick Replace GUIDs under Additional Settings.
  6. Click Run Search/Replace.

After the run, you see a success message with per-target counts (for example, the number of content items updated), or "No search found." if nothing matched.

Search and Replace

What the free version updates

Under Where to Update? you can select one or more of these targets:

Target What it updates
Content Post content across posts, pages, custom post types, and revisions
Excerpts Post excerpts
Attachments Media GUIDs for attachment posts
Links The WordPress links table (wp_links)
Custom Post meta / custom fields, with serialized data handled safely
Replace GUIDs All post GUIDs (an additional setting)

Free changes are immediate and irreversible

The free version writes directly to the database with a case-sensitive, whole-table replacement. There is no dry run, no undo, and no built-in backup. Take a full site backup before you run it. For a preview and one-click undo, use PRO.

Search and replace across selected tables (PRO)

PRO feature

Selecting specific tables, dry-run preview, case-insensitive matching, and undo are available in Update URLS PRO (background and undo engine added in 1.5.0).

PRO lets you search and replace any (non-protected) database table, not just the fixed content targets, and it accepts an arbitrary search string rather than only URLs.

  1. Go to Update URLS → Search & Replace.
  2. Enter your values in Search For and Replace With (a swap button lets you exchange them).
  3. Under Select Tables, move tables from Available Tables into Tables to Include using the dual-column picker (each table shows its size, and a filter box helps you find one).
  4. Set the Additional Settings toggles as needed:
    • Case-Insensitive — off by default (searches are case-sensitive unless you enable this).
    • Replace GUIDs — off by default.
    • Match escaped URLs in JSON data — on by default; matches JSON-escaped slashes (https:\/\/…) used by many page builders.
    • Run as dry run — on by default; computes the changes without writing anything.
    • Save as Profile — store the current settings for reuse.
  5. Click Run Search/Replace.

With Run as dry run on, results appear in a modal table with Table / Column / Row / Before / After columns and a checkbox on each row. Review them, then click Replace Selected to apply only the checked rows or Replace All to apply everything. A real (non-dry) replace runs as a background job with a progress modal and a Stop button, so it keeps going even if you close the tab. Completed runs are saved to History, where you can undo them.

Search and Replace PRO

Best practices

  • Back up first. In free mode changes cannot be undone; in PRO, undo depends on the history journal, so a full backup is still the safest starting point.
  • Enter exact values. Free matching is case-sensitive; PRO matching is case-sensitive unless you enable Case-Insensitive.
  • Preview in PRO. Keep Run as dry run on for the first pass and inspect the Before/After results before applying.
  • Start narrow. In PRO, begin with wp_posts, wp_postmeta, and wp_options (or your prefixed equivalents) and add custom tables only when needed.
  • Understand GUIDs. Only use Replace GUIDs when you know the implications — see What is a GUID and how to replace it.

Conclusion

Search and replace in Update URLS updates old URLs across your WordPress content in a single operation, with serialized data handled correctly. Run the free version for quick URL swaps after a backup, or upgrade to PRO for table selection, a dry-run preview, and one-click undo with history.

FAQs

Can I undo a search and replace in Update URLS?

Only in PRO. Every real PRO replacement writes an undo journal, so you can roll a run back from the History screen. A safety check restores a value only if it has not been edited since the run, and skipped rows are reported. The free version has no undo, so back up your site before running it.

Does search and replace work with serialized data?

Yes. Update URLS unserializes data, replaces the value inside it, and re-serializes it so array and object lengths stay valid. This is why you should use the plugin instead of a raw SQL query, which would break serialized options and meta. In PRO, the Match escaped URLs in JSON data option also catches JSON-escaped slashes used by page builders.

Is the free version case-sensitive?

Yes. Free search and replace is case-sensitive and matches the exact text you enter. There is no case-insensitive option in free mode. PRO adds a Case-Insensitive toggle, but it is off by default, so PRO matching is also case-sensitive unless you enable it.

What is the difference between the free and PRO search and replace?

Free replaces URLs across a fixed set of targets (content, excerpts, attachments, links, custom fields, GUIDs), is case-sensitive, and applies changes immediately with no undo. PRO adds arbitrary text search, selecting specific tables, case-insensitive matching, a dry-run preview, background execution with a Stop button, one-click undo with history, saved profiles, and database backup and import.

Do I need to back up before running search and replace?

Yes, always. Free changes are written directly to the database and cannot be reversed, so a full site backup is essential. In PRO you get a dry-run preview and undo, but a backup is still the safest starting point. PRO also includes one-click database backup and import.

Was this page helpful?