Weird WordPress problem: Wp-admin redirects to localhost

Have you experienced this weird problem? It most probably occurs when you develop your wordpress blog in your local server and upload the blog to your Internet web server. I too faced this problem when I uploaded my blog to my Internet server. Here’s how I got around it.

To rectify this problem in my way ( πŸ˜‰ ) you need access to the database which is used by your blog. I used phpMyAdmin to access the database of the blog. You can use any other tool you like. You need to edit an entry in a table of the database to rectify the problem.

First access the database and go to the table named wp_options ( sometimes this could be named as options too). There , you will find an entry named siteurl . You will see that this entry has the value( option_value) http://localhost/yourWpFolder . You need to edit this entry to your blogs URL. As an example, in my case I edited it as http://blog.ishans.info . After setting the value, click on Go and you’ll get a message saying the change was successfully done. Now you’ll see that β€œhttp://mySite.xxx/wp-admin” address is working.

But it’s not over yet. You need to set another setting in wordpress settings too. Log in as the Administrator to the wordpress dash board and go to Settings . In here you’ll see that the entry WordPress address (URL) is set to β€œhttp://mySite.xxx” , but the entry Site address (URL) is still http://localhost/yourWpFolder . So you need to set the Site address (URL) entry to β€œhttp://mySite.xxx” .

Thats it…!. Now save your settings and you’ll see that the whole site is working perfectly ( If it doesn’t have any other errors of course πŸ˜‰ )…..! πŸ˜€

Share Button

15 thoughts on “Weird WordPress problem: Wp-admin redirects to localhost

  1. machan i thinks dats somthin you server doesnt support(good thing). in some servers they do not allow local access to the server for several reasons. security and sometimes even they appear to you as local they are in the cloud. so u need to specify that manually.

  2. @Amila: Geek or not, my method is also on that page ;). Also, I’m not sure about that first method that is mentioned there, because if my memory serves me right I once tried that method ( a long time ago) to repair a wp blog in my localhost ( in which I have accidentally changed the blog’s address from localhost to some other url) and it didn’t work out:s .

    @Pasindu: I think you have not understood what I tried to resolve in this article( or I may not have understood your comment, so correct me if I’m wrong πŸ˜€ ). In this particular problem, When I entered the url “www.blog.ishans.info/wp-admin” , I was connected my local server( the lamp server that I’m running in my computer). I’m sure about this because when I shut down the apache server in lamp an error page came up. So I used the fix which is mentioned in this article to rectify the problem.

  3. @Malinga: ohh, seems like you have moved on to your own hosting space πŸ™‚ . You didn’t uses localhost means you developed the site while keeping it in the Internet server itself, isn’t it?

  4. I am newbie of using wordpress, when I moving my first wordpress blog from localhost this problem happend. It’s hard to find this discussion topic by search engine. finally this tips solved my problem thanks ishans

Leave a Reply

Your email address will not be published. Required fields are marked *