WordPress search and replace: change URLs and text safely

By Noiz / 19th October 2026 | 6 min

WordPress search and replace changes an old value everywhere in your database in one pass, and it is safe only with a tool that understands how WordPress stores its settings. After a move to a new domain, a switch from http to https or a change of business name, the old value sits in hundreds of places. This guide shows you how to replace it without breaking your settings, from the WordPress dashboard with a free plugin: a backup, a dry run that changes nothing, the real run, then checks.

Before you start

  • The site already works at its new address. If you have just moved to Noiz, follow How to Migrate a WordPress Site to Noiz Hosting first, including the WordPress Address and Site Address under Settings > General. This guide cleans up everything else.
  • You have a database backup taken now. A replace touches every table and has no undo. Export the database with How to Export a Database Backup in Plesk and download the file.
  • You know the exact old and new values. Copy them from a page source rather than typing them, including http or https, www or not, and no trailing slash. In these examples old-example.com and example.co.za stand for your own domains.
  • Administrator access to WordPress, to install a plugin.

Last reviewed: 19 October 2026, against the current WordPress release. This guide is written for Noiz hosting and is kept current against WordPress. It complements, and does not replace, the official WordPress documentation linked below.

Official Documentation Reference

Why does a plain database replace break WordPress?

Because WordPress stores many settings (widgets, theme options, page-builder layouts, menus) as serialised data, a format that records the length of every piece of text inside it. The address http://example.com is stored as s:18:"http://example.com";, where 18 is its length. Replace it with https://example.co.za using a plain SQL query in phpMyAdmin and the text grows, the 18 does not, and WordPress can no longer read the setting. Nothing fails at once; a widget or a layout disappears later.

The plugin below unpacks each setting, replaces the text and packs it again with the right length. That is why this guide uses it instead of a plain SQL query.

Step 1: How do you do a dry run of a WordPress search and replace?

Run the plugin with Run as dry run ticked. A dry run reports what would change and changes nothing. Always do one first.

  1. Go to Plugins > Add New Plugin, search for Better Search Replace, then install and activate it.
  2. Open Tools > Better Search Replace.
  3. Enter the old value in Search for and the new value in Replace with.
  4. Under Select tables, select all tables.
  5. Leave Replace GUIDs unticked and Run as dry run ticked, and select Run Search/Replace.
  6. Read the report of how many changes it would make in each table.

Step 2: What should you check in the dry-run report before you run it?

Check the number of matches in each table, and leave the guid column alone.

What the report shows What it means What to do
Zero matches The old value is not stored exactly as you typed it. Check http against https, www, and a trailing slash.
Matches in tables you did not expect, such as a plugin's log table Usually harmless. Read their names before you go on.

Leave the guid column alone. Each post's GUID is a permanent identifier that feed readers use, and WordPress's own migration guide says never to change it:

"Never, ever, change the contents of the GUID column, under any circumstances"

If it changes, every old post appears as new to your subscribers. Better Search Replace skips it unless you tick Replace GUIDs, so leave that box empty.

Step 3: How do you run the replacement?

Untick Run as dry run and select Run Search/Replace again.

Then repeat Steps 1 to 3 for each other form of the old value that exists, for example https://www.old-example.com and http://old-example.com. Replace the most specific form first.

Step 4: How do you check the site after a replace?

Clear the caches, refresh the address rules, then look at the places where serialised settings live.

  1. Clear any caching plugin's cache, and your browser's.
  2. Go to Settings > Permalinks and select Save Changes without changing anything. This refreshes WordPress's address rules.
  3. Open the home page, a post, a page built with your page builder, the menus and the widgets. These are where serialised settings live.
  4. View the page source and search for the old value. Anything left is usually in a cache or a form of the address you have not replaced yet.
  5. Deactivate and delete Better Search Replace when you are done. A plugin you no longer use is one more thing to keep updated.

Troubleshooting

Symptom Likely cause What to do
The report shows zero replacements. The search value does not match what is stored. Copy it from the page source, including the protocol and www.
A widget, menu or layout is empty after a replace. A plain SQL replace was used at some point, or a plugin stores its data in a format the tool cannot read. Import the database backup you took in Plesk and repeat the job with the plugin as described here.
Feed subscribers see every old post as new. The guid column was changed. Restore the database backup and run again with Replace GUIDs unticked.
You are sent back to the old domain and cannot log in. The WordPress Address and Site Address still hold the old domain. Follow the troubleshooting section of How to Migrate a WordPress Site to Noiz Hosting.

Read next:

Let Noiz Keep the Site Healthy

A replace is one step in a move. Once the site is on its new address, WordPress Care keeps it current and recoverable. If you would rather not do the replace yourself, get in touch.