A few months ago I put together a site using WordPress for a friend, I developed it on localhost and exported it to his live site paulscreen.com
I have recently been asked to do the same for someone else and I set about it the same way, my problem is at some point I accessed paulscreen.com (I don’t know how or when) and in doing so I have set his site to viciousnature.co.uk, I assume by changing the home url in the options panel in the admin area.
Now when I try to access the admin area for the first site, I get redirected to the second. I have been going through the wordpress code, but only have limited coding knowledge and cant find how to fix the mess up.
Where do I find the option to edit the home url, without using the admin area?
See Changing The Site URL « WordPress Codex for different methods to recover. You don’t necessarily have to be able to get into WordPress administration backend.
The easiest quick fix is add these
defineURL directives in wp-config.php:with the URL of the new domain, and those will override the URL settings in the database and the old domain. You’re hardcoding the URLs and you won’t be able to edit them on the General settings page anymore after using this method, but that will get you back into the site.
If you need to change domains when moving a site and database to a new domain, you need to use queries in phpmyadmin to change all URLs in the database, i.e. those site URLs, as well as in theme options, in post content, etc.
Important Update 2/20/2017:
When moving a site and a database to a new URL or domain, it’s now best to use this – interconnectit.com WordPress Serialized PHP Search Replace Tool – rather than queries directly in PHPMyAdmin that I posted above. The Interconnectit tool will correctly handle serialized data in the database, such as used by WordPress themes and plugins; using those queries in PHPMyAdmin will break such data, such as used for theme options, widget settings, etc, and you will have to reset all those options afterward, which can be a mess.