In this tutorial, I will be teaching how to fix Old URL redirects to your old domain name after transferring your website to a new domain & hosting.
Need help transferring your website? You can check out my article on How to transfer WordPress Website Manually to a New Web Hosting
Let’s get started.
How to Fix Old Redirects after Transferring Website to a New Hosting (Old to New Domain)
Changing The Site & Home URL
1) Login into your hosting Cpanel and click on “phpMyAdmin“.
2) Next, you will see the list of databases from the left navigation. Click on the one your website is using and you will be presented with a list of tables in that database
3) Located the table name ending with “_options” and click on “Browse“.
4) You will see all the rows making up the “_options” table. The option names you will want to make changes to are the “site URL & home”. The links will probably be that of the old domain name.
5) To change the links of the “siteurl & home”, click on the pencil edit icon on them.
6) For the site URL, enter the new domain name and click on “Go”.
7) For the home URL, enter the new domain name and click on “Go”.
Make sure both site Url & home Url are linking to the same domain.
After making the changes, you should be able to login to your website using the new domain name. But that’s not, other parts of your website will still be linking to the old domain, for example, posts & images. Let’s fix them.
Updating URLs of Page, Posts, Excerpts, Links, Attachments & Custom Fields
We are going to be using a WordPress plugin called: Velvet Blues. Although this plugin has not been updated for the past year, the plugin still works
1) From your WordPress Admin, Install & Activate the Plugin: Blue Velvet
2) Next, go to Tools > Update URLs
3) Enter the OLD Url & The New URL. Please double-check that the old URL is actually the old URL of your website and the new URL, is actually the new URL you want to update to.
If you make a mistake at this point your website may break, that’s why a backup of your website is recommended just in case.
Enter your URL like this
http://www.oldurl.com (if your old URL is using the www format without SSL) https://www.oldurl.com (if your old URL is using the www format with SSL) http://oldurl.com (if your old URL is not using the www format and without SSL) https://oldurl.com (if your old URL is not using the www format but with SSL) ------------------- http://www.newurl.com (if your old URL is using the www format without SSL) https://www.newurl.com (if your old URL is using the www format with SSL) http://newurl.com (if your old URL is not using the www format and without SSL) https://newurl.com (if your old URL is not using the www format but with SSL)
4) Next, check which URLs should be updated. Check all apart from “Update All GUID”.
5) Check you have entered your old and new URL correctly. When ready click on “ Update URLs Now“.
6) If setup correctly you will get the total number of links updated to the new URL.
You should be able to browse through your website without getting any link linking to the old domain.
But however, you may still have some custom post type with custom links, that you may have to update manually.