Change WordPress URL

If you’d like to move WordPress from one site to another, or simply replace your WordPress site’s domain name or URL address with a new domain name, you can manage it in your WordPress easily. This article offers specific instructions of domain management for self-hosted WordPress blogs and websites. There are different ways you can change WordPress site URL, such as changing code within WordPress configuration and function files. In this tutorial however we will introduce a simple method to get your WordPress site domain or URL address modified. You do not need to edit a single line of code. It is easy and intuitive.

Change WordPress Site URL from Dashboard

The domains you installed your WordPress blog on can be managed under Settings >> General in your blog’s dashboard. From there you can change site title, email addresses, site URL address, etc. See below screenshot.

change wordpress site address url in dashboard

From above image, you can see that the old WordPress domain can be found in both the WordPress Address (URL) and Site Address (URL). Replace them with the new WordPress domain. In this case, we changed it from http://test.betterhostreview.com to http://www.betterhostreview.com. Note that you should input full URL address, including the http:// part and should not have a slash “/” at the end. The site was installed on a temporary URL before going live. No we like to change the site URL to the permanent domain. When you have updated the domains of WordPress site, click Save Changes button to save and quit.

Now let’s go to change domain address of WordPress site from its database.

Change WordPress domain name from Database

WordPress site saves its data to a MySQL database. To change the URL address of a WordPress site, you need to open its database and edit the URL from there. phpMyAdmin is the most popular tool for MySQL database management. You should find this DB tool with most WordPress hosting service providers, especially those cPanel hosting providers, such as Bluehost, HostGator, Justhost, Arvixe, etc.

If you are not familiar with this phpMyAdmin tool, we suggest you to backup the database before making any changes. You can backup the MySQL database in phpMyAdmin or backup a database with backup tools in cPanel.

Log on your cPanel account. Scroll down to the Databases section, click on phpMyAdmin to run it. It will open in a new browser window or tab.

open phpmyadmin in cpanel

You can find all available MySQL databases from the left pane in phpMyAdmin. You can click to select and open the MySQL database for WordPress site. Alternatively you can click on the Database icon on the top tool bar. Then a list of existing databases shows in the main section of the page. See below screenshot.

edit mysql database in phpmyadmin

Open your WordPress database in phpMyAdmin, all the tables in your database will appear on the left side of the screen. Find and click on a table called wp_options. Note this table may have a prefix in front, you can define it when installing WordPress. When you opened the wp_options table, you will see a list of the available fields in this table. These lists or records will be separated into different pages, as this table contains many rows. The first one under the field option_name will be siteurl. This is the first item we have to change.

edit site url in database wordpress

Click the pen icon in front of the siteurl, you will open a editing screen as below. Here you can replace the old WordPress URL with the new WordPress domain name. You should input full URL address, including the http:// part and should not have a slash “/” at the end. In this case, we changed it from http://test.betterhostreview.com to http://www.betterhostreview.com. Click Go button to save the change and quit.

change site url in database for wordpress

Now let’s go to change another option named home. It may be found in the second page within the wp_options table. There are several pages of tables inside wp_options. Look for the > symbol to browse through pages.

edit wordpress home address in database

Now you have successfully changed WordPress URL from old domain to new domain. Go to browse your WordPress site with the new domain in browser, log in your dashboard through the new WordPress URL to make sure everything is working with the new WordPress domain name.

Change Name Servers for New Domain

New WordPress domain should also be added to your hosting account and pointed to the WordPress root folder. Also If your new domain and hosting are separated, you need to change name servers from domain registrar to web host, see some examples below:
How to Change name servers with GoDaddy?
How to Change name servers with Namecheap?

Redirect visitors and pass on SEO juice to new WordPress URL

If your old WordPress site or domain has some traffic you like to redirect to the new WordPress site URL, you can redirect the domain in cPanel. Make sure to set it up as 301 redirection to new WordPress URL, so not only you get visitors redirected, but also the SEO juice of your old site URLs. One common mistake many WordPress administrators make when they launch a new site with a new domain is to modify the permalinks (permanent links for WordPress posts and pages). You should keep your WordPress link structure intact between old and new domains, for example, if the old URL is http://www.olddomain.com/contacts.html, then the new URL should be http://www.newdomain.com/contacts.html, not http://www.newdomain.com/contacts/ or http://www.newdomain.com/2014/07/contacts/.

5.00 avg. rating (86% score) - 1 vote
Tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *