WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm working on a site which is not attached to a domain name yet, so I access to it through an ugly URL like old_server.something.myprovider.co.uk/.../.../

My provider moved me to a new server so I now have to type : new_server.something.myprovider.co.uk/.../.../

Problem is, when trying to access wp-admin, WordPress performs some sort of redirection to the old address and of course it doesn't work anymore. So I can't access the login page.

Is there a way to change the server URL in WordPress without accessing the dashboard ?

share|improve this question
up vote 3 down vote accepted

Yes cou can change it by accessing the database of your wordpress. It's located in the wp_options table of your wp' database. You'll have to change two values; the siteurl (line 1) and the home (line 37).

You can access it through the admin panel of your host and/or sometimes directly by typing in your browser the DB_HOST value you entered for the installation of the blog, now written in your wp_config.php file at the root of your site. Then just use the login and password also written in this file.

This should do it.

EDIT: i recommend the use of this kind of plugin to clean completely the database to change all your http://yourolddomain.com/whatever/ to http://yournewdomain.com/whatever/.

share|improve this answer

One of the quick things you can do is to edit wp_config.php. You'll want to do two things:

  1. change the database connection information if you need to (as @kevin mentions)
  2. add define('RELOCATE', true); to the very last bit of the file just above the line that says "stop editing"

Now, save wp_config.php and then go directly to the wp-login.php on your new url: http://new_server.something/myprovider.co.uk/.../.../wp-login.php

Login, and then immediately go to Settings > General and make sure you synchronize the URL in home and site url fields (RELOCATE only does the one, not the other). Save. Test.

Then, go back into wp_config.php and remove the RELOCATE definition you added in step 2.

Hope this works for you!

note: you'll run into additional difficulties if your database tables prefix has changed, but that doesn't appear to be the case according to what you described.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.