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

My permalink settings is simply /%postname%/ (yes I read from the codex that this is bad performance practice). The result is:

  • a page url might look like site.com/pagename
  • a blog post looks like site.com/post-title
  • a portfolio (custom post type) post will look like site.com/portfolio/item-1

I would like my blog post page (single.php) to have a URL like site.com/blog/post-title. How might I do that?

share|improve this question
up vote 3 down vote accepted

Change your permalink structure to /blog/%postname%/.


To get your custom post type to leave out the /blog part, in its registration arguments array, set the rewrite argument like this:

'rewrite' => array( 'slug' => 'portfolio', 'with_front' => false )
share|improve this answer
It won't "fail", those CPTs will just have 'blog' at the beginning of their permastruct. That's totally expected behavior. You could also filter those post types' rewrite rules on the '{$post_type}_rewrite_rules' filter, removing '/blog' from the beginning of any rule regexes. – John P Bloch Mar 29 '13 at 15:39

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.