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 tend to develop sites in a subdirectory, and I tend to use a fair amount of custom links in my menu ( the "Custom Links" option in the WP admin Appearance > Menus section) to display archive pages.

I am constantly annoyed at the fact that a relative link entered there will not take the subdirectory into account. For example, I have WP is installed in domain.com/dev.

I put a custom link "/events" in the menu, but it returns domain.com/events, which is 404, instead of properly returning domain.com/dev/events.

How can I change this behavior?

share|improve this question
you need to replace the new url in all the database after that you able to get that – Vikas Gautam Sep 18 '13 at 12:26

/events is not a relative link, it's an absolute link. The beginning slash forces it to the root of the domain. Of course, a relative link like events will be relative to the current page, so if you're on a page like this domain.com/dev/something/ it'll be domain.com/dev/something/events.

If you're developing a WP site that will eventually live at the root of the domain, I suggest you rethink your development process. Build the site on localhost or a subdomain, so that when you move you don't have to repoint links, just migrate, fix the DB, and go.

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.