Recover WordPress blog from an inactive domain name

I have a WordPress blog for which the domain name has expired. I can still nearly access the blog via a new domain name at the same host, but it seems like the original domain name is quite solidly baked into WordPress. Every time I get WordPress to serve just one page, all links on that page still point to the old domain name.

What is wrong with relative URL’s is another question for the WordPress team, but my real question here is how can I recover my blog and reopen it under a new domain name?

4 Answers
4

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