Skip to content
Accessibility
Theme
Text size
High contrast
Limit animations
Readable fontAtkinson Hyperlegible
Increased text spacing
Underline links
Always show focus

Runs in your browser — nothing you paste is uploaded.

WordPress Serialized Search-Replace

Change a URL, domain or path inside a PHP serialize() value without breaking it. A blind find-and-replace corrupts serialized data because each string is prefixed with its byte length; this tool unserializes, replaces, and re-serializes so the s:LEN: prefixes stay correct. Runs entirely in your browser.


      

Why a plain find-and-replace breaks WordPress

WordPress stores arrays and objects in tables like wp_options, wp_postmeta and wp_usermeta as PHP serialize() strings. Every string carries its length in bytes: s:19:"http://old.test/blog". If a database search-replace swaps old.test for a longer or shorter host, the text changes but the 19 does not — so PHP can no longer unserialize() the value and the option, widget or page-builder layout silently breaks.

How this tool fixes it

Paste the serialized value, type what to find and what to replace it with, and the tool decodes the structure, replaces inside every string, and re-encodes with freshly counted byte lengths. The output is valid serialized data you can write straight back to the database.

How to use it

Plain text

Leave the boxes unchecked for a literal swap — e.g. find http://old.test, replace with https://new.example. Tick Case-insensitive to ignore letter case.

Regular expression

Tick Regular expression to use a JavaScript regex in Find (applied globally). Use $1, $2 in Replace with for capture groups — handy for protocol-relative or wildcard host changes.

Already broken?

If the value has already been mangled by a previous search-replace and no longer unserializes, this tool can't decode it — repair the byte-lengths first with Fix Serialized Data, then swap safely here. To read or edit a value as JSON instead, use Serialized ↔ JSON or the Serialize / Unserialize tool.

Frequently asked questions

Why not just find-and-replace in a SQL dump?

Because PHP serialized strings store their length in bytes (s:19:"…"). A blind replace changes the text but not the number, so PHP can no longer unserialize the value and the option breaks. This tool decodes, replaces, then re-encodes with correct lengths.

When should I use WP-CLI's search-replace instead?

For a whole-database migration, wp search-replace is serialization-aware and faster — build that command with the WP-CLI tool. Use this page to fix or edit a single stored value by hand.

Related tools