Changing SITE URL and HOME settings directly in the WordPress admin dashboard
Changing SITE URL and HOME settings in wp-config.php
Changing SITE URL and HOME directly in the database via phpMyAdmin
When you migrate your WordPress installation to a different location or when you need the same site working with another domain name, changing SITE URL and HOME is a necessary step. These settings not only control the location of WordPress installation, but they are also responsible for the display of the URL in the admin section of your page, as well as the front end, and are used throughout the WordPress code.
If you need full instructions for WordPress migration, please check this article.
There are a few ways to change WordPress settings:
There are two fields named “WordPress Address (URL)” and “Site Address (URL)” on n the Settings->General screen.
To change settings login to WordPress dashboard as an administrator → Go to the Administration → Settings → General panel. Set the new location of WordPress core files in text boxes such as WordPress Address (URL) & Site Address (URL) → Save changes.
The “Site Address (URL)” is the address your visitors will type in the address bar of their browsers to access your WordPress site.
The “WordPress Address (URL)” indicates the location of WordPress core files.
Note: Both settings start from the HTTP:// part and should not have a slash “/” at the end.
This is another easy method to change WordPress settings. However, please note that this is not the best fix because in that case you won’t be able to edit SITE URL and HOME values on the General settings page anymore when using this method.
To change WordPress settings, please add these two lines to your wp-config.Php, where “domain.com” is the correct location of your site.
You can also use the IP of your domain instead of the name of your domain. For example,
If your WordPress installation is located in some sub folder, you need to add next two lines to the wp-config.php file where the “domain.com” is your domain name and “some folder” is a name of the folder where WordPress is installed:
At first, it is necessary to create a backup of the database your WordPress site is using just to be able to revert next changes back in case something goes wrong.
To change WordPress Address (URL) & Site Address (URL) in phpMyAdmin:
That’s it! Now your site should be pointed to its new location.