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 ?
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; thesiteurl
(line 1) and thehome
(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 yourwp_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/.
One of the quick things you can do is to edit wp_config.php. You’ll want to do two things:
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.
T