• Hi,
    Could someone explain how the WordPress General settings for
    Wordpress Address (URL) and
    Site Adress (URL)
    and the database wp-options
    siteurl and
    home
    is connected to each other. I am trying to give WordPress it’s own directory, and I want to change the value in the database with phpmyadmin.

    Giving WordPress Its Own Directory

    Is it:
    1.)
    Wordpress Address (URL) = home
    Site Adress (URL) = siteurl
    or
    2.)
    Wordpress Address (URL) = siteurl
    Site Adress (URL) = home

    The 1. seems more likely? But then what were they thinking when they named the WordPress Address (URL) db field to “home”? It could also easily connotate home as in the sense “the home url of the website”.

    And more:
    I guess that the define(‘WP_SITEURL’, ‘https://example.com/wordpress’); writes to the siteurl database field, and define(‘WP_HOME’, ‘https://example.com/wordpress’) writes to the database field home.

    • This topic was modified 5 years, 5 months ago by Argentum.
    • This topic was modified 5 years, 5 months ago by Argentum.
Viewing 3 replies - 1 through 3 (of 3 total)
  • WordPress Address is where WordPress can find it’s files. If you want to upload WordPress into a subfolder via FTP: /subfolder/ then your WordPress Address would be domain.com/subfolder/ because the WordPress files are actually uploaded to and can be found in subfolder. If the subfolder is not found on the server or WordPress is not in this subfolder then your website will run into issues.

    Site Address is going to be your actual domain. It doesn’t really care about the WordPress files or any subfolders WordPress may be in. It should be the same domain as the WordPress address though.

    These two fields in the General Settings are saved into the database options table:

    WordPress Address -> siteurl option name
    Site Address -> home option name

    These can be overridden on a file level basis via the wp-config.php file. If WP_SITEURL is set in the wp-config.php file it will use that value than whatever is saved in the database but it will not overwrite what is in the database. The same is said for WP_HOME.

    WordPress Address -> WP_SITEURL
    Site Address -> WP_HOME

    If you’re not sure if these values should be different then you’re better off keeping them the same. Only under specific circumstances should the two be different. Hopefully that makes sense but if unclear please reply below!

    Thread Starter Argentum

    (@argentum)

    Thanks! I still find it amusing that
    Wordpress Address saves its value in siteurl and
    Site Address in home.

    This contrary to what one would guess is the most probable: that Site Address is connected to siteurl. But it is the other way around. And it makes me shake my head. ?? So the rule is, the one with site in its name stores value in the the one that does not have site in its name.

    I make good use of this technique.

    Giving WordPress Its Own Directory


    It makes it very easy to make a develop site under the live site and then just switch which folder the wordpress files resides in.

    It doesn’t make much sense now, but it’s because WP is 16 years old. Back when the options were first created, it matched better. Now, the text in the admin has morphed away from the name of the options (which can’t change).
    It’s the same with the Homepage option. It used to say: Front Page and the option name is page_on_front.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘General Settings vs database settings’ is closed to new replies.