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:
- 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.
- 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.
- Navigate to plugin
In wp-admin, navigate to Tools > Better Search Replace.
- 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.
- 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.
- 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.
- 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!