• Hi all,I want my WordPress site set up so that all blog posts appear under /blog/ (e.g. /blog/post-title/). I’d also like to know if it’s possible for blog categories to appear as /blog/category/category-name/, but this is optional.The main issue is:When I try to set the post permalink structure to include /blog/ in the WordPress settings, all my custom post types (like jobs, teams, FAQs, etc.) also inherit the /blog/ prefix in their URLs, which I don’t want. I need custom post types to keep their own unique slugs (e.g. /our-team/example/, /jobs/example/), without /blog/ in the URL.How can I set things up so that only blog posts use the /blog/ prefix, categories optionally use /blog/category/, but custom post types are unaffected?Thanks for any advice or best practices!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You’re running into a common permalink limitation in WordPress. When you add /blog/ to your post permalink structure (e.g. /blog/%postname%/), it unfortunately applies to all post types using the 'post' rewrite slug — including custom post types, unless handled separately. ✅ Solution:

    To have only blog posts use /blog/ and keep custom post types clean (like /jobs/, /our-team/), you can do this:

    1. Leave your permalink structure as /blog/%postname%/
    2. Manually set the 'rewrite' => ['slug' => 'custom-slug'] argument in each custom post type’s registration. This overrides the global /blog/ prefix for that post type.

    Example (in your theme’s functions.php or CPT plugin):

    phpCopy code

    register_post_type('jobs', [ 'labels' => [...], 'public' => true, 'rewrite' => ['slug' => 'jobs'], ... ]);

    1. Flush permalinks after this by visiting Settings > Permalinks and clicking Save.

    If you’d like categories to appear like /blog/category/category-name/, go to:
    Settings > Permalinks > Optional and change the Category base to blog/category.

    Here are examples from my site that use the proper structure:

    Thread Starter svpgp

    (@svpgp)

    Thank you so much @xxbreadwinner . Works a treat 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to Add /blog/ Prefix to Posts, But Not to Custom Posts’ is closed to new replies.