# 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.

- Source canonique : [https://allaux.fr/en/glossaire/serialisation](https://allaux.fr/en/glossaire/serialisation)
- Langue : EN
- Dernière mise à jour : 2026-09-30

## 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.

## To avoid

> Replacing a URL directly in phpMyAdmin with a plain text SQL query, without a tool that understands serialised data, can corrupt settings or metadata in WordPress.

## FAQ

### 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.
