WordPress

How to Change Domain Name on WordPress

This tutorial explains how to change the domain name on WordPress.

By reading this article you will learn how to edit your WordPress site URL both from the WordPress dashboard and from your server through phpMyAdmin.

In case you do not have access to your dashboard through your new URL, you can achieve it from your server. This method includes the use of a plugin to update all the URLs in your site content.

All steps explained in this article include screenshots making it easy to follow them.

How to edit the domain name on WordPress using the dashboard settings

Instructions in this section are useful if you can access your dashboard with the old URL, otherwise, jump to the next section to learn how to change the WordPress URL using phpMyAdmin.

To change the domain name on WordPress from the dashboard, move your mouse cursor over the Settings option on the left menu, and then press General (Settings>General).

On the General Settings screen, find the lines WordPress Address (URL) and Site Address (URL). There, update your URLs, scroll down and press the Save Changes button.

After pressing the Save Changes button, your URL is updated.

Change the domain name on WordPress using phpMyAdmin

This section explains how to change domain name on WordPress from the database using phpMyAdmin.

In some cases you may need to perform this task from your server. For example, when you can’t reach your site due a non planned domain change.

To begin, access your phpMyAdmin and on the left menu find wpX_options. Where X is your database identificator. Press it to show the relevant tables to change your URL.

When the tables show up, you will see two named siteurl and home, as shown in the screenshot below. Each of them has a pencil icon next to the Edit link. Press the Edit link of siteurl to change it.

On the box containing your old URL, remove it and type your new domain name. Then press the Go button to save changes.

Then, go to the previous screen and  press the Edit button for home and repeat the previous steps replacing the old URL with a new one, and pressing the Go button to save changes.

Now your domain name is updated, but you still need to replace the old domain within your site content. Keep reading to know how to change the domain name on all your WordPress content.

Replacing the domain name on all your WordPress content

To find and replace the old domain on all your site I will show a plugin named Search & Replace.

To install it, on the dashboard left menu move your mouse cursor over Plugins, and then press the Add New option (Plugins>Add New).

On the Plugins installation page, type “search replace” to list available plugins. When the Search & Replace plugin shows up, press the Install Now button.

After installing the plugin, enable it by pressing the Activate button.

After activating the plugin, to use it on the dashboard left menu move your mouse pointer over the Tools option, then press Search & Replace as shown in the screenshot below.

On the Search & Replace configuration screen open the Replace Domain URL tab.

On this tab you will see two fields: Search for and Replace with. On the Search for field type the old URL, on the Replace With field type your new URL. To finish press the Do Replace Domain/URL button.

Now all the old URLs on your site are updated.

Conclusion

As you can see, changing your domain name on WordPress is pretty easy. All WordPress level users can achieve it in a few clicks as explained previously. This tutorial includes two methods: the simplest one from the dashboard, and the longer but also simple from phpMyAdmin in case you can’t access your dashboard.

Thank you for reading this WordPress tutorial. Keep following us for additional WordPress tips and tutorials.

About the author

David Adams

David Adams is a System Admin and writer that is focused on open source technologies, security software, and computer systems.