March 1, 2012

If you had changed the Wordpress Site Address accidently

Last week I was working on my new word press site http://thecuriosity.org and accidentally changed the Wordpress site address in the settings Menu and whoaa..a  my site faced problem connecting to the database.How i managed to get out of it,I'm jotting it down here.

So if you have accidentally changed the WordPress Site address in General Settings and now cannot access your site, this post is for you.

When I changed the URL i thought I'm changing it for the future reference to the live server but in fact I was not. I knew that i can fix it from PHPmyAdmin Panel but it would be more time taking.

After messing up with PHPmyAdmin ,I changed it but I have also learned a trick that only requires your being able to edit wp-config.php

Open up wp-config.php and paste these lines (with your site name) into it after the initial commenting:


define('WP_HOME', 'http://sitename.com');
define('WP_SITEURL', 'http://sitename.com');

After you do this,the text box will get disabled and you can now change the entry from wp-config.php file.


This is a good idea if you are passing a site off to a client who will have full admin access. This will prevent them from accidentally changing this very important WordPress option.

0 comments:

Post a Comment