I've searched around but have not been able to find an answer to my question.

What I'm trying to do is create a custom post type that exists within a sub-directory, not just after the root as is default.

For example right now I have:


I would like to have:


The reason I'm trying to do this is that I have a client that now has additional clients that I would like to have named as a sub-directory, and not an entirely new sub domain.

I was planning on creating custom post types to create the additional blogs or the two other clients, but I can't find a way of having a sub-directory first.

Is there an easy way to do this? I'm decently versed in WP but not an expert, so I'm hoping there is an easy-ish method.

Thanks for any guidance

1 Answer 1


When you register your post type, add the subdirectory to the has_archive argument, and as the slug argument of the rewrite argument:

$args = array(
    // ... other args removed for clarity
    'rewrite' => array( 'slug' => 'subdirectory/custom-post-type' ),
    'has_archive' => 'subdirectory/custom-post-type',
    // ...
register_post_type( 'your_cpt', $args );
  • Is it also possible to do the same thing with taxonomies? I tried putting the same path into the rewrite slug but I'm having trouble with it picking up my taxonomy-taxonomyname.php file. Any idea how to accomplish this? Thanks.
    – Ben
    Commented Jun 18, 2013 at 17:32
  • It should work for taxonomies as well. add the code you are using to the question, or perhaps it's best to ask a new question and provide the details there.
    – Milo
    Commented Jun 20, 2013 at 2:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.