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

How should I transfer my WordPress blog from the root of my domain to a sub-directory?

If everything including root in an installment of WP 3.2.1 were moved to a sub-directory, would the default permalink structure update to it? e.g. domain.com/wp-sub instead of wp-domain.com?

Also, should I modify any code or settings and, if so, what exactly?

share|improve this question
They will work, you don't have to do anything – onetrickpony Nov 28 '11 at 0:37

Moving all files from root to a subdirectory will work.
Don't forget the .htaccess file.
Just after move the files, you should change the root path in Configuration -> General - Site address. To the right direction.

i.e. Moving from http://example.com to http://example.com/blog/

share|improve this answer

I think you should also run a few MYSQL queries to make it work:

UPDATE wp_options SET option_value = replace(option_value, 'http://example.com', 'http://example.com/blog') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://example.com','http://example.com/blog');

UPDATE wp_posts SET post_content = replace(post_content, 'http://example.com/', 'http://example.com/blog');

If your permalinks are still not working, delete the .htaccess file, and go to Settings->Permalinks and click save to create the .htaccess file.

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.