How to Update Your Site URL With Better Search Replace for WordPress

Updating your site’s domain URLs becomes necessary on occasions such as transitioning from a development environment to production. However, before proceeding with the steps outlined in this guide, it’s crucial to perform a database backup to safeguard against unintended consequences.

While WP-CLI commands are provided for this purpose, they may be too technical for some users. In this article, we will explore an alternative solution using a user-friendly plugin called Better Search Replace. Below, we will walk through the process of setting it up and executing the necessary actions.

Better Search Replace

Time needed: 5 minutes

Step-by-step guide on how to use Better Search Replace:

  1. Create a backup of your database

    For safety measures, it’s crucial to perform a database backup to safeguard against unintended consequences. When this is done, please proceed to the next step.

  2. Install Better Search Replace

    Navigate to the plugins section of your wp-admin. Search for Better Search Replace in the right field. Click install and activate for the first plugin.

    Image of the Better Search Replace plugin in WordPress

  3. Navigate to plugin

    In wp-admin, navigate to Tools > Better Search Replace.

    Image of the Better Search Replace plugin found in the tools section in the WordPress admin dashboard

  4. Enter URLs

    In the two first fields, you will see what URL to search for and which URL you want to replace it with. So enter your current domain URL in the first field and the domain URL you want to replace within the second.

    Image of the search-replace section in the Better Search Replace WordPress plugin

  5. Select database tables

    To change all instances of the domain URL in your database simply select all tables. You can do that by clicking the tables field and entering CMD + A for Mac or CTRL + A for Windows.

  6. Disable dry-run

    Disable the “Run as dry run” option as dry-running will only simulate the search/replace and not actually do the search-replace.

  7. Run Search/Replace

    Lastly, click the “Run Search/Replace” button and you are done!

And as always, should you have any additional questions please don’t hesitate to contact our support chat at servebolt.com!