Available for projects & agency overflow · Quick reply, from the person who does the work

Serialisation: definition

Serialisation is the process that turns a complex data structure (array, object) into a storable text string, with the ability to reconstruct it identically afterwards.

Describe my issue Send a message

A technical mechanism that can trip up a simple URL change

In PHP, the serialize() and unserialize() functions store an array or object in a text column and retrieve it intact later. WordPress relies heavily on this mechanism: many settings, particularly in the wp_options and wp_postmeta tables, are stored in serialised form, in a format that includes the exact length of each string.

This detail is what makes a “blind” URL replacement risky when running a direct SQL query during a domain change or a switch to HTTPS: if the old URL is 20 characters long and the new one is 23, replacing the text without recalculating the declared length breaks the serialised structure, and the data becomes unreadable to WordPress. This is precisely why WP-CLI’s search-replace command exists: it correctly rebuilds serialised data instead of doing a simple text replacement.

Frequently asked questions

Does PrestaShop also use serialisation?
Some data stored by PrestaShop modules can use it, though WordPress relies on it far more systematically in its settings.
How can you tell if serialised data has been corrupted?
Typically, the setting in question disappears, reverts to its default value, or triggers a display error wherever WordPress tries to read that data.
Is there a reliable tool for changing a URL in WordPress?
Yes, WP-CLI’s search-replace command, designed to scan the database and fix serialised data without breaking it.

Describe your need in one minute

A few targeted questions so I can reply with an estimate rather than another questionnaire.

contexte
plateforme (facultatif)
question (facultatif)
Please provide an email or a phone number so I can get back to you.

Please provide an email or a phone number so I can get back to you.