Change the URLs of your site easily with the SRDB (Search And Replace DB) tool - I’ll explain how to do it.
This tool makes it very easy for you to change your links when changing your domain name or structure !
Without this tool, you’d have to go into PhpMyAdmin and manually change the links one by one, which can be very time-consuming if you have a lot of articles and pages.
There is also the DBSR Master tool that allows the same thing. You can follow our article dedicated to this tool if you want to use this one instead.
So, without further ado, here are all the steps in its use ;-)
For the more experienced among you, you can perform this kind of operation directly on the command line with expert mode via WP-CLI, accessible from your WPScale console. Just type the following command and it's done:
wp search-replace --all-tables --precise https://www.wrong-url.fr https://www.right-url.fr
Always try to do without the protocol and without the www:
wp search-replace --all-tables --precise wrong-url.fr right-url.fr
You don’t need to follow the steps below if you use the expert mode via WP-CLI.
Step 1: Download and send SRDB to your FTP
Click on the ZIP icon below to download the latest version of SRDB.
Once downloaded, unzip it and send the complete folder to the root of your site (next to the /wp-admin/, /wp-content/ and /wp-include/ folders), so that it can be accessed through a link like http://www.votredomaine.com/Search-Replace-DB-master/.
Step 2.1 : Enter the URLS and simulate the changes
Now you’re on the SRDB page, you have to enter the old URL as well as the new one and click on the "Dry run" button to simulate the change, as on the image below.
Once the "Dry run" button is clicked, the tool will search for the presence of old URLs and display the tables in which they’re found:
So we see that there are lots of URLs to correct.
Step 2.2: Make the changes permanently
Instead of simulating the changes, now that we know there are lots of URLs to change, we’ll make these changes permanently.
Click on the "Live run" button.
You can see that the same URLs detected earlier are detected again, and this time are fully updated for the new URL.
Final stage: Delete SRDB and purge the NGINX cache
Now that everything is changed, you can delete this tool by simply clicking on the "Delete" button at the bottom of the page.
You must also check that your theme or one of your plugins do not generate CSS or JS files containing urls. You’ll therefore have to purge these files from the settings pages or tools of your theme and/or plugins.
And all you have to do is purge your NGINX cache from your WordPress administration as shown in the image below, and empty your browser cache, following the article below: Empty browser cache.
Also, we advise you then to go to your WordPress administration in Settings => Permalinks.