Beware Settings->General Site URL, or Site Address (URL)

Changing Your Site URL, or Site Address

In Single site mode, WordPress 3.5.1 leads you to believe you need to change the site URL, or ‘Site Address (URL)’ if you want to run WordPress from a folder other than where you installed it


On screen is, “Enter the address here if you want your site homepage to be different from the directory you installed WordPress.”

NOT TRUE  according to that same Codex document, see section “Using a pre-existing subdirectory install”

Our idea with these paths is to point them to the location of the WP index.php that you use to ‘run’ WP. If index.php is in the root, then these paths must point to the root. If WP is installed in a subfolder and you wish to ‘run’ it from there, then append the folder path.

Quick Test of Site URL, or Site Address (URL)

Maybe you changed either of the above addresses and now you can’t get back into your site. Add these two lines near the bottom of wp-config which will override the fields ‘siteurl’ and ‘path’ that you just changed in the database table wp_options. Adjust the paths to the location of your index.php

define('WP_HOME','http://domain.tld');
define('WP_SITEURL','http://domain.tld');
/**** That's all, stop editing! Happy blogging. ****/

Note: These define paths used only when in Single site mode. While these are defined you will not be able to edit them in General -> Settings, only read them. But hey, it’s a quick method to test both settings until you get it right.

Making the Site URL, or Site Address (URL) Permanent

  • Confirm you can login and note the paths that work. Test all of your main site: posts, media, permalinks, etc.
  • Next step is to make the ‘home and siteurl’ changes in the database permanent
  • Then read Changing the Site URL for options on making your ‘test’ changes permanent.
  • This will also ensure that if Network is later installed, you can flip back to Single mode without errors

Once the database fields in table wp_options are set and tested, you can remove
define('WP_HOME','http://domain.tld');
define('WP_SITEURL','http://domain.tld');

from wp-config

 

Leave a comment

Your email address will not be published. Required fields are marked *

50 − 49 =