Making a few small adjustments here and there when managing your WordPress website is typically not a big deal. A WordPress search and replace may be required, though, if you need to edit multiple elements of your website at once.
For example, if you recently switched from HTTP to HTTPS, in this case, all of your HTTP URLs in the WordPress database need to be updated. If you’re switching domains, you might also need to update all the database references. Knowing how to execute a mass WordPress search and replace can save you a tonne of time in a variety of situations and help in SEO.
In this article, we’ll discuss How to do Search and replace in WordPress website and discuss when it would be important to use one.
How to do Search and replace in WordPress
There are many ways to do Search and replace in WordPress. But if you are a non-techy person, it is best to use a plugin. In this article, we will discuss the Better Search Replace plugin.
Better Search Replace plugin is an easy way to do a search and replace. There are other plugins as well to do the same task which you might want to explore. The best part about the plugin is you can delete it after the task is done. Let’s see the steps,
Step 1: Install the plugin
In the WordPress dashboard, go to Plugins, Add New plugin, search for ‘Better Search Replace’, install it, and activate it.
Step 2: Go to Better Search Replace
In the Tools tab, you will find Better Search Replace option. Click on it.
Step 3: Perform Dry Run
Now before executing a Search and Replace, first we will perform a dry run to check whether there are any HTTP URLs in the database or not.
In the ‘Search For’ box, enter the HTTP version of your website URL (http://www.example.com/)
In the ‘Replace With box, enter the HTTPS version of your website URL (https://www.example.com/)
In the ‘Select Table’ option, select all the tables by clicking Ctrl+A
In the ‘Additional Settings’ option, ‘Run as Dry Run’ is already selected. If not, click the check box.
And now just click on the ‘Run Search/Replace’ button. The Dry Run will start.
Step 4: Doing the actual Search/Replace
After performing Dry Run, you get the message of many tables were searched, cells found, and updated. A message like:
“DRY RUN: 35 tables were searched, 0 cells were found that need to be updated, and 0 changes were made.
Click here for more details, or use the form below to run the search/replace.”
Now you know how many cells need to be updated. We will perform the actual Search and Replace. With all the settings as previously done, just uncheck the Dry Run option and click on the ‘Run Search/Replace button. The actual Search and Replace will start. After the operation has been completed, you can delete the plugin.