How to change your WordPress Address (URL) and Site Address (URL)
- The "Home" setting is the address you want people to type in their browser to reach your WordPress blog.
- The "Site URL" setting is the address where your WordPress core files reside.
- Both settings should include the http:// part and should not have a slash "/" at the end.
- The site_url() will always be the location where you can reach the site by tacking on /wp-admin on the end, while home_url() would not reliably be this location.
- site_url() references the field labeled "WordPress Address (URL)" in General > Settings.
- home_url() would be where you have set your homepage by setting General > Settings "Site Address (URL)" field.
To change your WordPress Address (URL) and Site Address (URL)
It is possible to set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php:
(If you want your wordpress runs only on https, then you just need to change the above http to https)
You won't be able to edit them on the General settings page any more when using this method.
This option is good for me. Why you would prefer this way instead of changing directly in the admin panel? Because this change often makes you can not access your admin panel if you do not configure it correctly.