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 need to change the rewrite-slug of the built in post-type 'post' to 'example.com/magazine/news/any-nice-news-item'.

When I re-register the post-type 'post' and set the rewrite-slug to 'magazine/news' it works fine. But now I'm not sure about any side-effects. Does anybody have any positive or negative experience with that?

Here is the code:

register_post_type( 'post', array(
    'labels' => array(
        'name_admin_bar' => _x( 'Post', 'add new on admin bar' ),
    'public'  => true,
    /* internal use only. don't use this when registering your own post type. */
    '_edit_link' => 'post.php?post=%d', /* internal use only. don't use this when registering your own post type. */
    'capability_type' => 'post',
    'map_meta_cap' => true,
    'hierarchical' => false,
    'rewrite' => array('slug' => 'magazine/news'),
    'query_var' => false,
    'delete_with_user' => true,
    'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats' ),
) );
share|improve this question
What the propose of re-register post type post ? – qwerty qwerty Oct 30 '13 at 19:50

You do not need to re register post type.

Symply go in you backend, Settings > Permalinks and set the permalink structure to a custom one: /magazine/news/%postname%/ then save changes.

See image below:

enter image description here

share|improve this answer
Thanks for your suggestions. I already tried that. But unfortunately it also changed the url-base for the single-views of all custom post-types. – Matthias Lohscheidt Nov 1 '13 at 15:54
@MatthiasLohscheidt - that is controlled by the with_front argument when a custom post type is registered. it should be set to false to not add the post post type's prefix. – Milo May 10 '14 at 16:57
@Milo – good to know. I'll try that next time. Thanks! – Matthias Lohscheidt May 12 '14 at 19:11

I wouldn't recommend reregistering the 'posts' post-type. Modifying _builtins can be a headache.

It may be best to simply change the "category Permalink" under Settings > Permalinks to:


Or to create a subcategory named "news" with a parent category named "magazine", and use something like the "WP Htaccess Control" plugin to strip out the "category/" portion of the slug from posts.

share|improve this answer
Thanks Courtney! Probably you're right, it's better to leave the built-ins unmodified. The idea with the subcategory sounds interesting. But in the end I just created a new custom post-type called 'news' with a rewrite-slug of 'magazine/news'. I think that's a clean way to do it. – Matthias Lohscheidt Nov 1 '13 at 16:04

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.