Search & Replace SQL
Change your site URL without corrupting serialized data
Runs in your browser. Nothing is uploaded.
About the Search & Replace SQL
A naive SQL find-and-replace on a WordPress database breaks every serialized option it touches, because the stored string length no longer matches. This generates the queries that are safe, and explains exactly which ones are not.
Related
Other tools you might need
FAQ
Questions
Can I change my WordPress site URL with a SQL find and replace?
Not safely, and this is the most-shared bad advice in WordPress. Many options are stored as PHP-serialized strings that record their own byte length. A plain SQL replace changes the text but not the length, so PHP silently fails to unserialize the row and the value simply disappears — taking widget settings, theme mods and plugin config with it.
What should I use instead?
WP-CLI: 'wp search-replace old new --all-tables --dry-run' first, then without --dry-run. It understands serialization and rewrites the length prefixes correctly. If you have no CLI access, the Better Search Replace plugin does the same thing from the admin.
Should I update the GUID column?
No. The GUID is a permanent unique identifier for a post, not a link, and feed readers key off it. Rewriting it makes every subscriber see every old post as brand new. WordPress documentation says explicitly not to change it.