Detect and change WordPress address with RELOCATE
If you're having issues accessing your WordPress dashboard, you can have WordPress automatically try to figure out what
the correct WordPress Address should be using the RELOCATE flag in your wp-config.php file.
With the RELOCATE flag set, WordPress will automatically update your WordPress core files path to the URL used to
attempt to access the wp-login.php script. This only affects the WordPress dashboard and not the site itself.
Step 1. Edit your wp-config.php file.
Step 2. At the top of the file add a define('RELOCATE',true); line:
define('RELOCATE',true);
// ** MySQL settings - You can get this info from your web host ** //
Step 3. Now visit your http://example.com/wp/wp-login.php page in your web browser.
Be sure to type in the path of your WordPress core files before wp-login.php
Step 4. Log into your WordPress dashboard as you would normally.
Step 5. If you navigate to Settings >> General, you should now see that WordPress has automatically
populated the WordPress Address (URL) field for you, with the path to your WordPress files.
@tim-moody asked a week ago if we should consider re-homing WordPress more automatically?
If this is later deemed important, we might use the following mechanism (http://www.inmotionhosting.com/support/website/wordpress/wordpress-changing-the-site-url-and-home-settings) or similar:
See also official recommendation: https://codex.wordpress.org/Changing_The_Site_URL