In WordPress, wp_siteurl
and wp_homeurl
are two important parameters that play a critical role in defining the structure and navigation of your website. Understanding the difference between these two is key to configuring your WordPress site correctly.
-
wp_siteurl: This is the URL where your WordPress core files reside. It is the address where WordPress’s core application files are found. For example, if you’ve installed WordPress in a subdirectory of your domain like
www.yourdomain.com/wordpress
, then thewp_siteurl
would bewww.yourdomain.com/wordpress
. -
wp_homeurl: On the other hand,
wp_homeurl
is the address that points to your website’s homepage, where your main content resides. This is the URL visitors use to navigate to your site. So, if your website’s home page can be accessed viawww.yourdomain.com
, then thewp_homeurl
would bewww.yourdomain.com
.
Usually, when WordPress is installed in the root directory of the domain, wp_siteurl
and wp_homeurl
are the same. But if you have WordPress installed in a subdirectory or if you want your homepage separate from the WordPress installation directory, these two can differ.
In your WordPress configuration file (wp-config.php), you can define these two parameters as:
define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com/wordpress');
In this example, WP_HOME
refers to wp_homeurl
and WP_SITEURL
to wp_siteurl
.