Follow the different methods below to change your WordPress URL, also known as the WordPress Address (URL) and or Site Address (URL).
Be careful when editing these values, as you could bring your entire site down if they are entered incorrectly.
I. Change WordPress URL in Admin Dashboard
The most common method to change your WordPress website URL directly from within the admin dashboard.
On the left-hand side, under Settings, click into General. You can then update the following:
WordPress Address (URL): The address to reach your blog.
Site Address (URL): The address of your WordPress core files.
II. Change WordPress URL in wp-config.php File.
Second and most common way to change your WordPress URL is via your wp-config.php file.
It is important to note that values in wp-config.php override the settings in method one. If the fields are not editable (as seen below), it is most likely because they are hard-coded in this file.
The wp-config.php file is typically located under the root folder of your WordPress site and can be accessed via FTP, SSH, or login to cPanel File Manager.
To hard-code WP_HOME and WP_SITEURL, simply input the following code towards the top of the file, changing the values to reflect your domain.
You can always remove the two lines if you prefer to edit these values from the WordPress dashboard.
III. Change WordPress URL Directly in Database
Third method you can use to change your WordPress website URL is directly in the WordPress database using phpMyAdmin login to cPanel
- Login to your cPanel and navigate to phpMyAdmin menu.
2. Choose the database which is being used for your WordPress blog and click on it
If you are not sure what exactly database you need, check it inwp-config.phpfile which is located in the document root – in our case it is /public_html/wp/
3. Click onwp-optionstable and editsiteurlandhomefields