How to change the Site URL and Home URL Settings in WordPress?

WordPress offers two configurable URLs namely WordPress address and Site address to load the content correctly. WordPress highly relies on these URL settings as each of them have their own importance. More often WordPress beginners find these terms puzzling as what each one really does or why we need them. In this article, we will give you a complete understanding of these terms.


Site Address – Site URL


The Site Address or SITEURL is the address you want your website visitors to type in a web browser to reach your website. Say 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, both SITEURL and WordPress URL (HOMEURL) will be same unless you install WordPress in a separate folder.

For example, if you install WordPress into 
the document root  (/home/cPanel_user/public_html/) then your WordPress URL and SITEURL will be the same. To access the WordPress dashboard, you will have to visit http://mydomain.com/wp-admin.

If you install WordPress in some subdirectory, say 'wordpress' then your SITEURL would be http://mydomain.com/wordpress. To access the admin dashboard, you will have to visit http://mydomain.com/wordpress/wp-admin.


Why you need to change these URLs?


You will require to change these URLs when you move a WordPress website to a new location or you want to shift your website to brand new domain. These options are most useful when you develop the new version of your site in some subfolder and you wish to move in the root directory when it is ready.



How do I change these URLs?

Using WordPress admin


At WordPress dashboard, you are given an option to modify these URL values. Once you are logged into WordPress dashboard, navigate to Settings >> General page. Enter the new value for WordPress Address or Site Address and click Save Changes.

 Wordpress Admin


Using wp-config.php file


The easiest way to modify WordPress URLs is via the wp-config.php file.
  1. Edit your wp-config.php file.
  2. Insert following 2 lines and define your WP_HOME and WP_SITEURL in wp-config.php file. Please note that adding SITEURL in the wp-config.php file will override the WordPress admin settings.

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

Change WordPress address from database


Sometimes your previous changes may lock you out from WordPress dashboard access. In such case, you may directly modify WordPress URL settings from the WordPress database using the phpMyAdmin tool. Following instructions will guide you on how to change the WordPress website URL using phpMyAdmin in cPanel.

  1. Before you make any changes to WordPress database, first backup WordPress database.
  2. Login to cPanel and navigate to phpMyAdmin menu.

    Login to phpmyadmin

  3. Select the database which is being used for your WordPress website.

    Select wp-options table

  4. Click on wp_options table and find option_name namely siteurl. Click the checkbox then click Edit.

    Siteurl and Home

  5. Change the option_value to the correct URL. Scroll to the bottom and click Go to save the change.

    Change Siteurl

  6. Search option_name namely home and repeat the process.


  • 5 Users Found This Useful

Was this answer helpful?

Related Articles

How to Use WP_DEBUG?

Introduction PHP is a well known programming language used by Wordpress having its own debugging...

How to install WordPress

How to install WordPress This tutorial will show you how to install WordPress. For this...

How to fix an error SSL certificate problem, verify that the CA cert is OK?

You may encounter this error while performing actions like theme/plugins installation or...

How to Install and Configure W3Total Cache WordPress Plugin?

Installing a caching plugin is the most effective way to accelerate the page loading speed of...

How to reset WordPress admin user's password?

There are several ways to reset WordPress admin user password in WordPress. A simple method is to...