This guide will teach you how to change the domain of your WordPress website
To complete this guide, please ensure you have:
- Your cPanel login credentials
If you have forgotten your cPanel credentials, they were included in the original Welcome to Serversaurus or IMPORTANT: Hosting Documentation email which you should find in your inbox, otherwise follow our instructions on updating your cPanel password.
- A WordPress administrator login
To login to WordPress please ensure you have a WordPress administrator username and password.
Let's get started!
- Login to cPanel and go to the Domains function.
Select Create A New Domain.
In our example below, we are adding newdomain.com.au. Enter your new domain name, deselect the option Share document root and enter public_html as the document root. The other settings can remain as the defaults. To save your configurations, select Submit.
Note: This guide assumes you're changing the domain of the primary website within your cPanel account which is hosted in the public_html directory. If you're website is hosted in a different document root, you need to adjust the document root with the path specific to your set up.
- Using the WP Migrate Lite plugin, we will perform a find & replace on the database. For the find and replace, we will search for the old domain and replace any occurrences with the new domain.Login to WordPress dashboard and navigate to Plugins >> Add New >> Install WP Migrate Lite >> Activate Plugin. Then continue to Tools >> WP Migrate >> Migrate >> Find & Replace.In the Find field, add the current domain prepended with two forward slashes (eg. //), this ensures only domain URL references are updated.
For the Replace field, enter the new domain also with two forward slashes, for example:
Select Find & Replace.
The find & replace can take awhile so please be patient and remain on the same page. Once the task is complete, you'll be automatically logged out of WordPress, you can login again using the same username and password as before.
- The WordPress domain has been changed successfully. You can optionally install a SSL certificate for the new domain using the Let's Encrypt SSL function in cPanel so your website can load over a secure connection (HTTPS).
Last updated November 30, 2023