I have a wordpress install that I have been working on and now I want develop the install on my local server. I have downloaded all of the site files and added it to my local server directory. I also exported the live database and import into the local install's database.

The only credentials that I changed for the database are the: database name [new name], database user [root], database password [no password], database server [localhost].

After making these changes to the wp-config.php and load the site it loads the home page correctly, but...all of the other pages are still referencing the live site's url. I attempted to fix this by defining the wp_home and wp_siteurl to 'local/sitefolder'

define('WP_HOME', 'localhost/sitefolder');
define('WP_SITEURL', 'localhost/sitefolder');

After doing this I access the site, but now the css isn't being applied. This alone is weird because when checking the reference url for the css it's the correct path, but with firebug it shows that the document couldn't be found.

I also notice that all the urls add the defined url to the urls...For example, the homepage's link should be 'localhost/sitefolder' but after defining the urls it is now 'localhost/sitefolder/localhost/sitefolder.'

I went into the database and searched for any reference to the live urls and replaced them with local path, but that didn't fix it.

I was wondering if maybe I had to define the absolute path of the local server.

Can someone please tell me how to fix this? I have been trying to fix the problems for 4 days now with no success. Thanks for any helpful feedback.

1 Answer 1


Remove WP_HOME and WP_SITEURL from your wp-config.php, and then check in the wp_options table for the values "siteurl" and "home" and change them to http://localhost/sitefolder. It must be an absolute URL.

The WP Codex has more information about changing the site URL.

  • Thanks Devin, I solved it before ready your answer. The way I did it was by taking the exported sql file and doing a find-and-replace all all reference to the live urls with the local url and that did the trick. I wish I thought it before! Thanks
    – user1893
    Commented Nov 18, 2011 at 3:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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