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

I've had this issue several times now. While building a site, including some content, I keep wordpress in a subdirectory (say, /wordpress/). When putting it live, I move/copy 3 files out of the dir into the root, in accordance with the WordPress specifications here http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory#Using_a_pre-existing_subdirectory_install

It works, but all the links already entered in content refer to /wordpress/bla/bla and will, after the move, return 'file not found'. Also, links previously sent in emails and links already indexed by Google will return file not found.

My question is: is this behaviour as designed, or am I doing something wrong ?

Please note: my question is not how to fix it. It's easy enough to add some lines to the root .htaccess to say 'for every request inside /wordpress/, if it doesnt exist, remove the word /wordpress/ and try again', so I'm surprised wordpress doesn't do that by itself - this makes me think I'm doing something wrong ...


share|improve this question
up vote 0 down vote accepted

You're not doing anything wrong. WordPress does not monitor the links within content, so it's up to you to change them when your structure changes.

share|improve this answer
well .. ok. so the issue sounds familiar ? i'm wondering why wordpress doesnt just add a rewriterule for in-directory links; it shouldnt have to change the content. – commonpike Feb 8 '13 at 17:23
It's familiar. I usually go into PHPMyAdmin and run a couple of queries directly to update the links. Obviously one should back-up the DB before doing this or do a test run first. – vancoder Feb 8 '13 at 17:25

In the past, we used a "Search and Replace" plug-in for WordPress to mass change the content of a site that was moved to a new hosting server.

Not sure if this plug-in will work for you, but you can give it a try:


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.