sandywp / plugins / better-search-replace

Better Search Replace

4.3 out of 5 stars. 4.3 544 reviews

A simple plugin to update URLs or other text in a database.

Launch a sandbox with this plugin → No signup.
Ready in seconds.

v1.4.11 1,000,000+ installs WP 6.2+ PHP 8.1+

your-sandbox.sandywp.com/wp-admin
Better Search Replace running inside a SandyWP sandbox

What you get inside

2 screens
  • The Better Search Replace page added to the "Tools" menu

  • After running a search/replace dry-run.

About this plugin

When moving your WordPress site to a new domain or server, you will likely run into a need to run a search/replace on the database for everything to work correctly. Fortunately, there are several plugins available for this task, however, all have a different approach to a few key features. This plugin consolidates the best features from these plugins, incorporating the following features in one simple plugin:

  • Serialization support for all tables
  • The ability to select specific tables
  • The ability to run a “dry run” to see how many fields will be updated
  • No server requirements aside from a running installation of WordPress
  • WordPress Multisite support

Time-saving features available in the Pro version:

  • View exactly what changed during a search/replace
  • Backup and import the database while running a search/replace
  • Priority email support from the developer of the plugin
  • Save or load custom profiles for quickly repeating a search/replace in the future
  • Support and updates for 1 year

Learn more about Better Search Replace Pro

The search and replace functionality is heavily based on interconnect/it’s great and open-source Search Replace DB script, modified to use WordPress native database functions to ensure compatibility.

Want to contribute?

Feel free to open an issue or submit a pull request on GitHub.

Questions

Using Better Search Replace

Once activated, Better Search Replace will add a page under the “Tools” menu page in your WordPress admin.

Is my host supported?

Yes! This plugin should be compatible with any host.

Can I damage my site with this plugin?

Yes! Entering a wrong search or replace string could damage your database. Because of this, it is always advisable to have a backup of your database before using this plugin.

How does this work on WordPress Multisite?

When this plugin is installed on a WordPress multisite network:

  • Subsite administrators can only search and replace within tables that belong to that subsite by visiting Dashboard > Tools > Better Search Replace from WP Admin of the subsite.
  • Network administrators (i.e. Super Admins) and administrators of the primary site can search and replace across all tables in the multisite network by visiting Dashboard > Tools > Better Search Replace from WP Admin of the primary site.

To change which users have access to the plugin, the user capability can be modified via code using the bsr_capability filter.

How can I use this plugin when changing URLs?

If you’re moving your site from one server to another and changing the URL of your WordPress installation, the approach below allows you to do so easily without affecting the old site:

  1. Backup the database on your current site
  2. Install the database on your new host
  3. On the new host, define the new site URL in the wp-config.php file, as shown here
  4. Log in at your new admin URL and run Better Search Replace on the old site URL for the new site URL
  5. Delete the site_url constant you added to wp-config.php. You may also need to regenerate your .htaccess by going to Settings -> Permalinks and saving the settings.

More information on moving WordPress can be found here.

4.3

544 reviews

  • 5 ★ 431
  • 4 ★ 15
  • 3 ★ 11
  • 2 ★ 17
  • 1 ★ 70

Ratings come from WordPress.org. SandyWP does not collect its own reviews.

sandywp / also on the shelf

Try another plugin

Spin up a real WordPress site in seconds.

Test plugins, build a demo, hand a client a link — then squash it and start again. No local setup, no Docker.