the lab
WordPress Serialized Search & Replace
Upload a WordPress .sql export, tell it what to change (old domain to new domain, http to https, whatever), and it fixes every matching value, including the PHP serialized data most find-and-replace tools quietly corrupt. Nothing is uploaded, the file never leaves your browser.
WordPress stores a lot of settings, widgets, and page-builder layouts as PHP serialized strings, and those strings carry a byte-length number right inside them, like s:23:"https://old-domain.com";. A plain text find-and-replace, in a text editor or in phpMyAdmin, changes the visible text but leaves that length number wrong. PHP's unserialize() then fails on that value, silently, and whatever it held, a widget, an Elementor section, a theme setting, is just gone. The SQL file still looks fine. The site doesn't.
The correct fix, what WP-CLI's search-replace command does, is to actually parse the serialized structure, replace inside it, and recalculate the length. That normally needs shell or WP-CLI access on the server. This does the same thing entirely in your browser against a plain .sql export, for the common case where that access isn't available.
NO_BACKSLASH_ESCAPES enabled aren't supported.- Your file is read into memory in your browser and split into every single-quoted SQL string literal, since that's where all the actual data values live.
- Each value is tested against a real PHP serialized-data parser. If it parses cleanly as an array, object, or serialized string, it's treated as serialized; anything else is treated as plain text.
- Serialized values are walked recursively, your search terms are replaced inside every string, and each changed string's length prefix is recalculated from its actual UTF-8 byte length, not character count, before being written back.
- Everything untouched, table structure, unrelated rows, unrelated values, is left byte-for-byte identical to your original file.
When you need a serialization-safe WordPress search and replace
A WordPress search and replace that understands serialized data is the right tool any time a database export contains text you need to change, and that text might sit inside a widget, a page-builder layout, or a theme option. The common cases:
- Changing the domain. Moving from an old domain to a new one, or from a temporary address to the real one.
- Moving from http to https. Updating every stored URL after you add an SSL certificate.
- Staging to live. Replacing a staging URL with the production URL before you import the database.
- Changing a path or folder. Updating a server file path, or a site that moved into or out of a subfolder.
Because this works on any text in the export, you can add several find and replace pairs and run them in one pass. Each pair has its own case sensitive option.
What this tool does and doesn't do
It reads your .sql export in the browser, fixes the matching values, and gives you a new .sql file to download. It never connects to your site or changes your live database. You import the fixed file yourself, which is why a backup comes first.
It supports standard mysqldump and phpMyAdmin exports, which use backslash-escaped, single-quoted strings. Exports from unusual tools, or ones made with NO_BACKSLASH_ESCAPES enabled, aren't supported. After a run, you get a table showing how many values changed in each database table and how many of those were serialized values, so you can check the result before importing it.
Frequently asked questions
Why can't I just find and replace the domain in a text editor?
WordPress stores a lot of settings as PHP serialized strings, which include a byte-length prefix like s:23:"https://old-domain.com";. A plain text replace changes the text but not that length number, so PHP's unserialize() fails silently and the data (widgets, Elementor layouts, theme options) is lost even though the SQL file still looks fine.
Does this upload my database export anywhere?
No. The .sql file is read and processed entirely in your browser with JavaScript. It's never sent to any server, which matters since a database export can contain password hashes and user emails.
Is this the same thing WP-CLI's search-replace command does?
Yes, the same underlying idea: detect serialized values, replace inside them, and recalculate the length prefix correctly. This exists for the common case where you don't have shell or WP-CLI access on your hosting and are working from a plain .sql export instead.
Does it change my live website directly?
No. It produces a fixed copy of your .sql file for you to download. Your live site and database aren't touched until you import that file yourself, so keep your original export and a backup of the database.
How large a .sql file can I use?
Everything runs in your browser, so very large files can be slow. The tool shows a warning above 60 MB, since processing may take a while and the tab can briefly stop responding. If your export is that big, export only the tables that need fixing, usually wp_options, wp_postmeta, and wp_posts.