PHP serialized data stores the byte length of each string. A blind search-and-replace can change the text while leaving the stored length unchanged, making an entire option or metadata value unreadable.
Confirm that serialization is the failure
Look for unserialize() warnings, empty widgets, missing theme settings or page-builder layouts that vanished immediately after the replacement. Compare one damaged row with a pre-change backup rather than guessing the correct length.
Restore before you attempt another migration pass
If a clean backup exists, restoring the affected rows is safer than hand-editing serialized strings. Once the original value is back, repeat the replacement with a WordPress-aware tool and a dry run.
Keep the table and column scope explicit
- target only tables that need migration;
- exclude GUIDs unless there is a deliberate reason;
- check JSON and escaped URLs separately;
- include multisite tables only when the network is in scope.
Connect the repair to the migration symptom
If the replacement was intended to remove an old hostname, first review why WordPress can still use the old domain after migration. A database repair should solve a confirmed storage problem, not substitute for checking server redirects or cache.
Do not save broken settings repeatedly
Opening and saving a plugin or theme screen can overwrite a damaged but recoverable value with an empty default. Preserve evidence until you know which row is affected.
Verification after the repair
Complex settings and layouts should match the pre-migration state, logs should contain no serialization warnings, and a controlled dry run should show only expected remaining old-domain values. If URLs still fail at the routing layer, compare the post-migration permalink checks.
WP REPAIR INCIDENT STANDARD
How to narrow the fault without guessing
The resulting failures can look unrelated: missing theme settings, empty widgets, broken page-builder layouts or fatal unserialize warnings.
Identify the replacement command, affected tables and available pre-change backup.
Look for unserialize warnings and empty configuration after the change.
Compare a damaged row with the backup rather than editing length values manually.
Check JSON, escaped URLs and multisite tables separately.
What must be verified
- No unserialize warnings remain.
- Complex settings and layouts match the pre-migration state.
- A dry run shows no unintended old-domain values in active configuration.
Official technical sources
Continue the diagnosis
This guide explains the diagnosis. If the site is affected now, the intervention should preserve a rollback path and verify the real business journey.
See the emergency repair service →ABOUT THIS SYMPTOM
Frequently asked questions about this guide.
Why does a simple find-and-replace on the domain name break unrelated settings like widgets or page-builder layouts?+
PHP serialized values store the exact byte length of each string alongside its content. Replacing a domain with a string of a different length without recalculating that stored length corrupts the entire serialized value, which can make widgets, theme settings, or builder layouts appear empty or throw unserialize warnings.
Can running the same search-replace twice make things worse?+
Yes. If URLs were already migrated correctly in a previous pass, running the operation again can modify already-correct data nested inside escaped strings, a failure mode distinct from the original single-pass corruption and one that needs its own check.
Is it safe to keep saving settings in wp-admin while serialized data is broken?+
No. Continuing to save settings in the admin can cause plugins to overwrite the damaged but still partially recoverable values with empty defaults, closing off the option to restore them from the original data.
Should the GUID column be included in a domain search-replace?+
Generally no, unless there's a deliberate reason to change it. GUID values are meant to remain stable identifiers, and excluding that column from the replacement operation is one of the standard precautions to avoid unintended side effects.