Replace Manager

Sooner or later something has to change across an entire WordPress database at once — a domain after a migration, http to https across thousands of links, a product name, a phone number in a footer widget. Doing it by hand is impossible and doing it with a plain SQL query is dangerous.

The danger has a specific name: serialized data. WordPress stores many settings as PHP arrays with the length of each string recorded alongside it. Replace a ten-character string with a twelve-character one using a naive query and the recorded length is now wrong, and whatever read that option stops working — often a page builder’s entire layout, silently, days later.

These guides cover doing it safely. Running a dry run first so you can see how many rows would change before any of them do. Scoping a replacement to the tables that need it rather than the whole database. Handling the serialized fields correctly. And the two most common jobs, domain changes after a move and http to https across old content.

There is also an article on undoing one, which is the reason the dry run and the export come first.

If you take one habit from this module, take the dry run. It costs a minute and it turns an irreversible operation into a reviewable one.

Get All in One WP SettingsGet Plugin