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

Even though this question sounds like others here is my problem:

The site I am updating had a permalink structure of /%postname%, during this time I created a custom post type of "popups" (rewrite slug = 'popups') so the urls were:


Now the site has a blog, and the permalink structure has been changed to /blog/%postname%, this changed the custom post type url structure to:


I want to keep the blog permalink structure as /blog/%postname% but I want to have a custom url structure for my custom post type that is not tied to the blog permalink. So instead of the urls for my custom post type of popups showing up as:


I want it to show up as:


while retaining the blog permalink of /blog/%postname%

share|improve this question
Did you move your WordPress installation to blog sub-directory? – Mamaduka Sep 6 '11 at 19:04
/blog is not a sub-directory, its a prefix to the permalink – farinspace Sep 7 '11 at 20:22
up vote 1 down vote accepted

When you registered the post type, one of the arguments was rewrite, which took an array. make sure there's a with_front argument in the rewrite array, and set it to false.

$args = array(
    // other stuf...
    'rewrite' => array( 
         'slug' => 'popups',
         'with_front' => false
     // other stuf...

register_post_type( 'type', $args );

That should take care of it.

Important: Be sure to flush your rewrite rules after changing the code (go to settings > permalinks and hit save).

share|improve this answer
You don't have to hit save to flush your rewrite rules, just visiting the page will do it :) – helenhousandi Sep 7 '11 at 0:51
Does anyone know if it is possible to attach /%year%/%month%/%postname%/ AFTER the slug? I'm in dire need of the code to attach that AFTER the slug, but BEFORE the postname. I would super-hugely-massively appreciate any help :) – cmegown May 15 '12 at 20:33

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.