> Free in-browser tool to replace URLs in a WordPress SQL export without breaking PHP serialized data, and to fix broken serialized values.

Source: https://nitramix.com/tools/wordpress-serialized-search-replace

Free tool

# WordPress Serialized Search and Replace Move domains without breaking data.

Change the site address in a WordPress database export without breaking widgets, theme settings or page builder content. Serialized lengths are recalculated for you, and the file never leaves your computer.

## Replace a URL in your SQL file or fix a broken serialized string

### What to replace

Usually the old and new site address. The JSON-escaped (https:\\/\\/) and URL-encoded forms are replaced too.

### Your database export

The file is processed on your computer and never uploaded. Keep your original file as a backup.

## Why plain find and replace breaks WordPress

Serialized data stores the length of every text in bytes. Change the text without the number and PHP cannot read the value any more.

### Before

```
s:14:"http://old.com";
```

### Plain find and replace

```
s:14:"https://new-site.com";
```

Says 14 bytes, has 20. The whole option is lost.

### This tool

```
s:20:"https://new-site.com";
```

Lengths are counted in bytes, so accented letters and emoji stay correct. Nested serialized values and JSON with escaped slashes (`https:\/\/`), which page builders like Elementor use, are handled too. Values that were broken before the change are reported and left as they are.

## How to move WordPress to a new domain with this tool

The database is the tricky part of a domain change, because the old address is stored in thousands of places. These five steps cover it.

1.  1

    ### Back up

    Download a full backup of files and database, and keep it untouched until the new site works.

2.  2

    ### Export the database

    phpMyAdmin (Export, SQL, UTF-8), WP-CLI "wp db export" or your host's backup tool.

3.  3

    ### Replace the address here

    Add every version of the old address (http, https, www) as its own pair and download the new file.

4.  4

    ### Import on the new site

    Import the new SQL file into the new database and update the database details in wp-config.php.

5.  5

    ### Clean up

    Log in, save Settings > Permalinks once, clear every cache and check images, menus and forms.

## Moving a whole site? Use a migration tool

Editing SQL files by hand is fine once. For regular moves between staging and live, a migration plugin copies the files and database and rewrites the addresses for you. See our guides on [pushing staging to live](https://nitramix.com/blog/push-staging-to-live-wordpress) and the [best backup and migration plugins](https://nitramix.com/blog/best-wordpress-backup-migration-plugins).

Revertix plugin

### Test updates on a staging copy first

Revertix makes a staging copy of your site in a few clicks, takes a backup before every change and rolls back when an update breaks something. Free, with a PRO plan.

[See Revertix](https://nitramix.com/projects/revertix)

Website fixes

### Something already broke?

White screen, critical error or a checkout that stopped working after an update. We find the cause and fix it.

[Get help now](https://nitramix.com/services/website-audit-and-fixes)

## FAQ

### Why does find and replace break serialized data in WordPress?

WordPress and many plugins save settings as PHP serialized data, where every piece of text carries its length in bytes, like s:14:"http://old.com";. A plain find and replace changes the text but not the number in front of it. PHP then refuses to read the whole value, and widgets, theme options or page builder content silently disappear. This tool rebuilds every changed value with the correct lengths.

### Is my SQL file uploaded to your server?

No. The file is read and changed by your own browser, in a background worker on this page, and the new file is created on your computer. Nothing is sent to us or anyone else.

### Can I use this to change my domain after a migration?

Yes. Export the database, replace the old address with the new one (for example http://old-site.com with https://new-site.com), and import the new file into the new database. If you have shell access to the server, the WP-CLI command "wp search-replace" does the same directly in the database and is a good alternative.

### What is the maximum file size?

There is no fixed limit; it depends on your browser's memory, because it holds the old and the new file at the same time. We tested the engine with a 150 MB export, which took a few seconds. For very large databases, use a desktop browser with few other tabs open. Compressed .sql.gz files work too.

### How do I fix "unserialize(): Error at offset"?

That error means a serialized value has a wrong length, usually after a find and replace on the database. Copy the broken value from the database, paste it into "Fix a serialized value" above and the tool shows where it breaks and gives you a corrected version to paste back. Take a backup before you change anything.

### Which database exports does it work with?

Plain SQL exports from phpMyAdmin, mysqldump, WP-CLI (wp db export), Adminer and most hosting backup tools, as .sql or .sql.gz. The export should be UTF-8 (utf8mb4), which is the default for current WordPress sites. CSV and XML exports are not supported.

### Should I replace http and www versions too?

Yes. Old content often mixes http://, https://, with and without www. Add each version you find as its own pair, for example http://old-site.com, https://old-site.com and https://www.old-site.com, all pointing to the new address. Search your SQL file for the old domain first to see which versions it contains.

### Will it also change post GUIDs?

Yes, it changes the value wherever it appears, including the guid column of wp\_posts. For a site moving to a new domain that is usually what you want. If people follow your RSS feed and you want to keep the old GUIDs, use WP-CLI with --skip-columns=guid instead.

### Why were some serialized values already broken?

They were broken before you ran this tool, usually by an earlier plain find and replace or a migration plugin that failed halfway. The tool does not guess how to fix them during a bulk replace. Copy each one into "Fix a serialized value" to repair it on its own.

## More free tools

### WordPress Update Safety Check

Enter a site address and see what is visible from outside, with a risk score before you update.

Open tool

[WordPress Update Safety Check](https://nitramix.com/tools/wordpress-update-safety-check)

### WordPress Plugin Health Checker

Paste your plugin list and see which plugins are outdated, closed or untested with the latest WordPress.

Open tool

[WordPress Plugin Health Checker](https://nitramix.com/tools/wordpress-plugin-health-checker)

### WordPress PHP Compatibility Checker

Pick a PHP version and see which of your plugins require newer PHP or may block the upgrade.

Open tool

[WordPress PHP Compatibility Checker](https://nitramix.com/tools/wordpress-php-compatibility-checker)

### Website Cost Calculator

How much does a website cost? Pick what you need and get a price range and timeline right away.

Open tool

[Website Cost Calculator](https://nitramix.com/tools/website-cost-calculator)

### WordPress Plugin Development Cost Calculator

How much does a custom WordPress plugin cost? Pick the type, size and features and see a price range.

Open tool

[WordPress Plugin Development Cost Calculator](https://nitramix.com/tools/wordpress-plugin-development-cost-calculator)

### SaaS MVP Cost Calculator

Pick the features your SaaS needs and see what fits a fixed-price MVP and what to leave for phase two.

Open tool

[SaaS MVP Cost Calculator](https://nitramix.com/tools/saas-mvp-cost-calculator)

[All free tools](https://nitramix.com/tools)
