Recover WordPress blog from an inactive domain name

If you have problems to log even into your blog, edit wp-config.php:

Add these two lines to your wp-config.php, where “example.com” is the NEW location of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

This will at least make it useable again (but won’t fix links inside post and page content, see Ticket #4003). .

Additionally you can add this third line:

define('RELOCATE',true);

Then go immediatly to http://example.com/wp-login.php and login as normal. When the RELOCATE flag is set to true, the siteurl (NOT the home setting) will be automatically updated to whatever path you are using to access the login screen. This will get the admin section up and running on the new URL, but it will not correct any other part of the setup. Those you will still need to alter manually. (Source)

More information on how to change the URL can be found in Changing The Site URL (WordPress Codex).

Leave a Comment