Search & Replace

Bulk search and replace text across your WordPress database

Search & Replace can scan your entire WordPress database — site options, post and user meta, page content and comments — and safely replace a given string. Each scope shows the actual DB table name, so you always know exactly what you’re touching.

Key features

  • Full scope: wp_options, postmeta (ACF included), usermeta, termmeta, post_content, comments
  • Each scope shows the real database table name
  • Serialize-safe — never a raw string/regex replace on a serialized blob
  • Recursively unpacks data, replaces only actual values (never keys), then re-serializes
  • Typical use cases: domain migration, URL changes after a site move, or bulk text fixes

How it works

The core of the module is `SerializeSafeReplacer` — it detects whether a value is serialized (`is_serialized()`), and if so, `unserialize()`s it, recursively walks every leaf value, replaces only inside string values (never inside array keys), and re-`serialize()`s the result.

This approach is necessary because the serialized format contains length prefixes like `s:12:"original text"` — a plain string/regex replace would break the whole structure the moment the text length changes, and WordPress would fail to unpack the data on read.

Compared to alternatives

An alternative to Better Search Replace — with full table scope included for free.

Frequently asked questions

Is it safe to run a replace across the entire wp_options table?
The module handles serialized data safely, but we still recommend a database backup before a bulk change — it’s an irreversible operation on production data.
Will an ACF repeater field break after replacing?
No — SerializeSafeReplacer works with the unpacked structure and only changes text values, so composite ACF fields stay valid.
Can I replace text in comments too?
Yes, comment content and author fields are among the supported tables.