What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Back up your WordPress database, preview the matches, then use a serialization-aware tool such as WP-CLI or Better Search Replace to make the change. A broad SQL text substitution can corrupt structured values stored by themes and plugins, so don’t start with a blanket database-wide REPLACE().
Choose the right method for your site
| Method | Access | Preview and data handling | Scope |
|---|---|---|---|
| WP-CLI | Terminal access and familiarity with command-line tools. | --dry-run previews changes; WP-CLI says the command handles PHP serialized data and leaves primary key values unchanged. It can also export transformed SQL. |
Supports explicit tables and table or column inclusion and exclusion. By default it uses tables registered to $wpdb; on multisite, that means the current site unless you add --network. |
| Better Search Replace | WordPress admin interface. | The plugin listing describes dry-run operation and serialized-data handling. Check its current listing, compatibility, and interface before installing. | Review the plugin’s current interface and options to confirm the intended tables and scope before applying a change. |
Handwritten SQL REPLACE() |
Database access and a precise understanding of the target column and value. | Does not automatically handle serialized data safely; a broad substitution risks corrupting stored values. | Only consider for a narrowly understood case with separate validation and a recoverable backup; it is not a general WordPress replacement method. |
WP-CLI’s behavior and available options are documented in the wp search-replace reference. The Better Search Replace plugin listing is the place to check its current details.
Why serialized data changes the risk
The database can contain PHP serialized data: structured values that include string lengths. A plain text substitution may change a string without updating its stored length, leaving the value invalid. The WordPress migration handbook warns that blanket URL replacement can damage this data. WP-CLI’s search-and-replace command is designed to handle PHP serialized data; an ordinary SQL REPLACE() does not provide that protection automatically. See the WordPress migration handbook.
Back up before editing
Before changing a production database, export it or use your host’s backup and restore checkpoint process. Keep the backup somewhere you can retrieve it, and verify that it belongs to the database you intend to edit. WP-CLI documents database export on its project site; the migration handbook also advises backing up before migration work. A backup is useful only if you can restore the correct one.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Find the text when you are not sure where it appears
From the WordPress installation, run wp db search 'old-text' to search text columns. The command is case-insensitive by default. Its default multisite search is limited to the current site; use the network option when you need to search registered tables across the network. Check the wp db search reference for the command’s options and behavior.
Preview and apply a replacement with WP-CLI
Preview the proposed change
For a domain migration, a preview might look like this:
Rank #2
wp search-replace 'https://old.example' 'https://new.example' --dry-run
With --dry-run, WP-CLI reports the projected operation without saving changes. Review the report. If the matches reach beyond the content you intend to change, adjust the search text or narrow the table or column scope before proceeding.
Rank #3
Apply only after reviewing the scope
Once the preview is right, run the same command without --dry-run. You can name tables explicitly and use options to include or skip tables and columns. The default is the tables registered to $wpdb; on multisite that covers the current site unless you specify --network. Be cautious with --all-tables, which expands the operation beyond registered WordPress tables. The command reference lists the available scope controls.
For a migration, the WordPress handbook’s example skips the guid column. Treat that as a migration-specific scope choice, not a universal rule for every text replacement. Select columns according to the change you are making and the guidance for that task.
Rank #4
Use a dashboard plugin if you prefer not to use a terminal
Better Search Replace is an option for site owners who want an admin interface. Its WordPress listing describes serialized-data handling and a dry-run mode. Before installing, check the current plugin listing for compatibility and confirm how its present interface scopes and previews the operation. As with WP-CLI, make a recoverable backup first and inspect the preview before applying changes.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Handle multisite and wide table scopes deliberately
- Single site: WP-CLI’s default table set is the set registered to
$wpdb. - Multisite, current site: The default search-and-replace scope is the current site’s registered tables.
- Multisite, network: Add
--networkwhen the operation should cover registered tables across the network. - All tables: Use
--all-tablescautiously because it includes tables beyond the registered WordPress set.
A wider scope is not inherently better. Match the tables and columns to the text you need to change, especially when a network contains sites with different content or settings.
Avoid blanket SQL replacement
Do not run a database-wide SQL REPLACE() for arbitrary text or URLs. It can change serialized strings without correcting their stored lengths. A raw SQL update may be appropriate only when the target column and value are narrowly understood, and then only with separate validation and a reliable backup. For general WordPress content or a domain migration, use a serialization-aware method instead.
Recovery if the change was too broad
If the applied replacement affected unintended data, stop making further database edits and restore the matching database backup or host checkpoint. If you cannot verify that the backup corresponds to the database you changed, ask your hosting provider to help identify the correct restore point before proceeding.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

