How to properly prefix blog post URL’s

Assuming that you are not using a plugin to handle your post types but are registering them manually:

Add the rewrite argument to your register_post_type() function calls.

$rewrite = array(
    'slug' => $slug,
    'with_front' => false
);

$args = array(
    // your other arguments
    'rewrite' => $rewrite
);

register_post_type( 'name_of_your_post_type', $args );

If your registering your post types with some plugin, check whether it has an option to set with_front to false. It defaults to true (unfortunately, for your sake).

Whether there’s a plugin out there that has this feature I don’t know – never used no post type plugin(s).

Leave a Comment