Title: Lucid Search &amp; Replace &#8211; Safe Database Find and Replace with Preview and Undo
Author: Ibrahim
Published: <strong>August 23, 2026</strong>
Last modified: August 23, 2026

---

Search plugins

![](https://ps.w.org/lucid-search-replace/assets/banner-772x250.png?rev=3662066)

![](https://ps.w.org/lucid-search-replace/assets/icon-256x256.png?rev=3662066)

# Lucid Search & Replace – Safe Database Find and Replace with Preview and Undo

 By [Ibrahim](https://profiles.wordpress.org/ibrahimhajjaj/)

[Download](https://downloads.wordpress.org/plugin/lucid-search-replace.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/lucid-search-replace/#description)
 * [Reviews](https://wordpress.org/plugins/lucid-search-replace/#reviews)
 *  [Installation](https://wordpress.org/plugins/lucid-search-replace/#installation)
 * [Development](https://wordpress.org/plugins/lucid-search-replace/#developers)

 [Support](https://wordpress.org/support/plugin/lucid-search-replace/)

## Description

Changing a domain, moving off a staging URL, or switching to HTTPS means rewriting
text all through your database. Most tools do it blind: you type into a box, press
go, and hope. When the value is serialized (theme settings, Elementor layouts, WooCommerce
data) a plain replace miscounts the length prefix and corrupts the row, and there
is no way back.

Lucid Search & Replace is built the other way around. You preview representative
matches before anything is written, can take a safety snapshot, and can undo unchanged
cells while that snapshot is retained. Nothing about that is held behind an upgrade.

#### What makes it safe

 * **Visual preview, always free.** Up to 20 representative matches per table, grouped
   by table and column, with the exact characters that change highlighted. Review
   them, then decide.
 * **Serialized-data safe.** The engine walks serialized arrays and objects, replaces
   inside them, and recalculates the `s:N` byte-length prefixes so the value stays
   valid.
 * **Handles the case other tools miss.** Page builders store URLs as JSON inside
   serialized data, with escaped slashes (`http:\/\/`). A search for `http://` never
   matches that, so the old link silently survives. This engine decodes the JSON,
   replaces, and re-encodes in the original style. Base64-wrapped values are handled
   the same way.
 * **Optional snapshot and one-click undo.** When enabled at confirmation, affected
   cells are copied before each write. Undo restores cells that still contain the
   applied value and reports later edits as conflicts.
 * **Protected by default.** Network-global, user, and login tables are excluded
   from site-level runs. Post GUIDs are left alone unless you ask, because changing
   them breaks feeds and comments.

#### Built for real sites

 * **Background batching for large databases.** Work runs in bounded batches through
   Action Scheduler and resumes from durable progress after each completed batch.
 * **Regex, case sensitivity, and exclusions** for precise control, all optional
   behind an Advanced panel so a first-time user is never overwhelmed.
 * **Target specific tables** while safely discovering their text columns, or scan
   every eligible site table.
 * **Automatic cache purge after a run.** Regenerates Elementor CSS and clears WP
   Rocket, LiteSpeed Cache, and W3 Total Cache so the site does not keep serving
   old URLs.
 * **Downloadable CSV of retained preview excerpts**, streamed through an authorized
   admin route when change logs are enabled.
 * **WP-CLI** for scripted and staged migrations.
 * **Multisite aware.**

#### A note on the paid product

The search and replace here is complete and free. If you are moving an entire site
rather than rewriting text, SafeGuard handles full migrations with scheduled off-
site backups. It is mentioned in the plugin’s own Pro Tools tab and nowhere else.
You never need it to use everything on this page.

#### Source code and build process

The full, uncompiled source lives at https://github.com/ibrahimhajjaj/lucid-search-
replace

The admin screen is a TypeScript and React application under `src/`. The shipped`
build/index.js` and `build/style-index.css` are generated from it with @wordpress/
scripts (webpack). To reproduce them from a checkout:

    ```
    composer install
    npm install
    npm run build

    npm run package assembles the distributed zip. Translation templates are regenerated with `npm run make-pot`.
    ```

Bundled third-party library: Action Scheduler by Automattic (GPL-3.0-or-later), 
https://github.com/woocommerce/action-scheduler, installed under `vendor/` via Composer
and used for background batch processing.

## Screenshots

[⌊The search and replace form, with the safety steps alongside it.⌉⌊The search and
replace form, with the safety steps alongside it.⌉[

The search and replace form, with the safety steps alongside it.

[⌊The visual diff preview, grouped by table, showing exactly what changes.⌉⌊The 
visual diff preview, grouped by table, showing exactly what changes.⌉[

The visual diff preview, grouped by table, showing exactly what changes.

[⌊The confirmation step, where you can enable a safety snapshot before applying.⌉⌊
The confirmation step, where you can enable a safety snapshot before applying.⌉[

The confirmation step, where you can enable a safety snapshot before applying.

[⌊The result, with one-click undo when a retained snapshot is available.⌉⌊The result,
with one-click undo when a retained snapshot is available.⌉[

The result, with one-click undo when a retained snapshot is available.

## Installation

 1. Upload the plugin to `wp-content/plugins/lucid-search-replace`, or install it from
    the Plugins screen.
 2. Activate it.
 3. Open Tools then Lucid Search & Replace.
 4. Enter what to find and what to replace it with, press Preview changes, review the
    diff, then apply.

Always run a preview first. It never writes anything.

## FAQ

### Will this corrupt my serialized data?

No. When a value is serialized the engine parses it, replaces inside the structure,
and re-serializes so the byte-length prefixes are recalculated correctly. A value
it cannot parse is skipped and reported rather than guessed at, so a broken row 
is never written.

### Does it work with Elementor and other page builders?

Yes. Builders store URLs as JSON inside serialized data with escaped slashes. The
engine detects that, decodes the JSON, replaces, and re-encodes in the original 
escaping style. The preview marks those rows so you can see it working.

### Is the preview really free?

Yes. The visual diff is never restricted. It retains up to 20 representative matches
per table, and apply is bound to the completed preview so new candidates are not
silently added afterward.

### Can I undo a replace?

When you enable the safety snapshot at confirmation, the success screen offers Undo
while the snapshot is retained. Undo restores a cell only if it still contains the
value written by that run, so later edits are preserved and reported as conflicts.
Snapshots are pruned after 30 days.

### What is protected by default?

Network-global tables, including users and usermeta, are excluded from site-level
runs so a site administrator cannot damage network data or logins. Post GUIDs are
protected by default and can be included from the Advanced options.

### How does it handle a large database?

Processing runs in bounded background batches and persists progress after each batch.
This reduces request-timeout risk and lets work continue after you leave the page.

### Can I use it from WP-CLI?

Yes.

    ```
    wp safesr replace 'http://staging.example.com' 'https://example.com' --dry-run
    wp safesr replace 'http://staging.example.com' 'https://example.com'
    wp safesr undo <job-id>

    --dry-run reports what would change without writing. Every apply creates the same snapshot the admin does.
    ```

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Lucid Search & Replace – Safe Database Find and Replace with Preview and Undo” 
is open source software. The following people have contributed to this plugin.

Contributors

 *   [ Ibrahim ](https://profiles.wordpress.org/ibrahimhajjaj/)

[Translate “Lucid Search & Replace – Safe Database Find and Replace with Preview and Undo” into your language.](https://translate.wordpress.org/projects/wp-plugins/lucid-search-replace)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/lucid-search-replace/),
check out the [SVN repository](https://plugins.svn.wordpress.org/lucid-search-replace/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/lucid-search-replace/)
by [RSS](https://plugins.trac.wordpress.org/log/lucid-search-replace/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release: serialized and JSON-inside-serialized safe engine, free sampled
   visual diff preview, optional snapshot and guarded undo, background batched processing,
   regex and targeting options, cache purge integrations, WP-CLI, multisite support.

## Meta

 *  Version **1.0.0**
 *  Last updated **1 day ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.2 or higher **
 *  Tested up to **7.1**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [database](https://wordpress.org/plugins/tags/database/)[elementor](https://wordpress.org/plugins/tags/elementor/)
   [migration](https://wordpress.org/plugins/tags/migration/)[search replace](https://wordpress.org/plugins/tags/search-replace/)
   [serialized](https://wordpress.org/plugins/tags/serialized/)
 *  [Advanced View](https://wordpress.org/plugins/lucid-search-replace/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/lucid-search-replace/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/lucid-search-replace/reviews/)

## Contributors

 *   [ Ibrahim ](https://profiles.wordpress.org/ibrahimhajjaj/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/lucid-search-replace/)