How to Migrate a WordPress Website to a New URL


Migrating a WordPress website is a pretty simple affair once you know what to change – it basically boils down to moving the database and website files to a new server, and then updating the wp-config.php file in the root of your WordPress installation. If you don’t already know how to do this then please see this post on moving WordPress to a new server. Assuming you’re OK with this process, you should be able to update your website’s URL without too much issue.

The first thing to remember is that this is all dealt with in the database. In fact there are just two fields you need to change initially in order to update the website’s URL (you should already have moved the website to the new hosting space). Get yourself into phpMyAdmin, click on your database name, and then click on the wp-options table. At the top, rows 1 and 2 should show the previous address of the website. Double-click each field and change the old address for your new one. Now that you’ve done this you should be able to login to the website at the new URL, i.e. www.yournewwebsiteurl.com/wp-admin. Once you’ve logged in, you need to install a plugin called Velvet Blues Update URLs (I have no idea why it’s called that – it is free though!).

Once you have Velvet Blues installed, hover over ‘Tools’ within the WordPress admin, and click ‘Update URLs’. Input your old URL in the top box, and your new one in the bottom box. Tick all of the boxes underneath except for ‘Update ALL GUIDs’, then click ‘Update URLs NOW’ – you will then be presented with a lovely list of everything that’s been updated. Finally, you need to visit your ‘Permalinks’ page twice (the link will be provided once you have run ‘Update URLs NOW’). Once you’ve done this you can deactivate and delete the Velvet Blues Update URLs plugin, and everything should be complete.

Of course, there are several other ways of migrating your URL, but it’s important to remember not to simply run a ‘find and replace’ on your website’s MySQL database. A lot of the time this will work, but the presence of serialized data within the database can cause the process to break, so it’s not recommended.