How to Change WordPress Site URL

/ Category: Tutorials / Comments: None

Spread the love

In this tutorial we are going to show you How to Change WordPress Site URL. WordPress site administrators every now and then need to move an existing site under a new domain name and the site may not work properly after the migration if the WordPress site URL is not updated to match the new domain name. In this tutorial we will show you few methods about how to change the site URL in WordPress on a Linux Virtual Private Server.

Change WordPress site URL via SSH/FTP

The first method requires SSH or FTP/SFTP access to the server. Connect to your Linux server and search for the wp-config.php file. It should be located in your WordPress installation document root. Once you find it, open the file and add the following lines:

define('WP_HOME','http://newdomain.com');
define('WP_SITEURL','http://newdomain.com');

Of course, replace newdomain.com with the new domain you want to use for your WordPress site. This option hardcodes the value for the new domain and you will not be able to change it by using some of the other methods.

Change WordPress site URL via WordPress Dashboard

This method is certainly the easiest one and requires no special technical knowledge. Simply, log in to your WordPress Dashboard as an administrator, navigate to Settings and click on General.

Here, you will see two fields, WordPress Address (URL) and Site Address (URL). Update the values with the new domain and scroll down to save the changes. Once the changes are saved, you may no longer be able to access the WordPress Dashboard using the old domain name.

Change WordPress site URL via phpMyAdmin

The last method we are going to cover in this tutorial is by using phpMyAdmin. phpMyAdmin is a tool written in PHP which can be used to manage the MySQL databases on your Linux VPS via web interface.

Log in to your phpMyAdmin and select the MySQL database you are using for your WordPress site. Access the options table. Depending on your current database settings the prefix may differ, for example, if you are using the default wp_ prefix the name would be wp_options.

Here, you will be able to see two rows, siteurl and home. Click on the edit button and update the value for both with the new domain name you are planning to use for your WordPress site.

Once you change the WordPress site URL you will be able to access your WordPress site and WordPress dashboard using the new domain name. In case you have hardcoded some of your blog posts with the old domain name, you will need to update them and change the old domain name with the new one.

Of course, you don’t have to change the WordPress Site URL yourself, if you use one of our fully managed wordpress servers, in which case you can simply ask our expert Linux admins to help you change your WordPress site URL on your server for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Be the first to write a comment.

Your feedback