WordPress offers two configurable URLs to load the content correctly: the WordPress address and the Site address. WordPress highly relies on these URL settings as each has its importance. However, WordPress beginners often find these terms confusing about what each one does or why we need them.
So, in this article, we will provide you with a complete understanding of the WordPress address and Site address.
Site Address – Site URL
The Site Address or Site URL is the address you want your website visitors to type in a web browser to reach your website. For example, if your website is mydomain.com, then http:// mydomain.com is your site address.
WordPress Address – WordPress URL
The WordPress address is the location of the core WordPress files. In most cases, the Site URL and WordPress URL (HOMEURL) will be the same unless you install WordPress in a separate folder.
For example, your WordPress URL and Site URL will be the same if you install WordPress into the document root (/home/cPanel_user/public_html/). To access the WordPress dashboard, you will have to visit http://mydomain.com/wp-admin.
If you install WordPress in some subdirectory, such as 'WordPress,' your site URL would be http://mydomain.com/WordPress.
To access the admin dashboard, you will have to visit http://mydomain.com/WordPress/wp-admin.
Why do you need to change these URLs?
It would help if you changed these URLs when you move a WordPress website to a new location or you want to shift your website to a brand-new domain. These options are most useful when you develop the latest version of your site in some subfolder and move it to the root directory when it is ready.
- Using WordPress admin
- Using wp-config.php file
2. Once logged into the WordPress dashboard, navigate to Settings >> General page.
3. Enter the new WordPress Address or Site Address value and click Save Changes.
The easiest way to modify WordPress URLs is via the wp-config.php file –
- Edit your wp-config.php file.
- Insert the following two lines and define your WP_HOME and WP_SITEURL in the wp-config.php file.
Adding the Site URL in the wp-config.php file will override the WordPress admin settings.
Change WordPress Address from the Database
Sometimes your last changes may lock you out from WordPress dashboard access. In such a case, you may directly modify WordPress URL settings from the WordPress database using the phpMyAdmin tool.
The following instructions will guide you on changing the WordPress website URL using phpMyAdmin in cPanel.
1. Back up the WordPress database first before making any changes to the WordPress database.
2. Log in to cPanel and navigate to the phpMyAdmin menu.
3. Select the database which is being used for your WordPress website.
4. Click on wp_options table and find option_name - siteurl.
5. Click the checkbox, then click Edit
6. Change the option_value to the correct URL.
7. Scroll to the bottom and click Go to save the change.
8. Search option_name - home and repeat the process.
→ Are you looking to change the WordPress URL?
Refer to the Change WordPress URL for more details.