The Goal

I would like to format my permalinks as follows:

  • for posts: somePrefix/%category%/%postname%
  • for categories: somePrefix/%category%

Where somePrefix is the same in both cases.

I know that there is no big upside to this - it just seems "clean" to me :) . And it comes in handy if you want to manually edit the URL.

What I Tried

No Category Base

One approach is to define the posts' permalinks as /%category%/%postname%/ and use a plugin to get rid of the category base. Unfortunately those plugins seem to be buggy and are discouraged to use (e.g. by Yoast SEO Plugin).

Same Category Base

No problem, I thought, let's just use the category base in the permalinks as so: category_base/%category%/%postname%. This produces:

  • for posts: example.org/category_base/%category%/%postname%
  • for categories: example.org/category_base/%category%

This works for the categories but now links to posts produce 404s.

Now What?

So is there a way to achieve this? A setting, a plugin or perhaps even hacking WordPress a little to properly process the links which created by Same Category Base?

  • Your issue is that your desired structures are too close. The second approach looks like it should work in principle, but because the prefix is same posts are getting confused with category names. Not sure how to best untangle it, especially in a robust way.
    – Rarst
    Commented Jun 9, 2014 at 18:32
  • 4 years and this still hasn't been correctly answered. Someone found out anything about this?
    – marvinpoo
    Commented Dec 18, 2018 at 16:03

2 Answers 2


I may be missing some vital detail in the question but here's what I did to make this work.

Settings -> Permalinks

Set the permalinks to...


This will give you the following permalinks...

Blog Page     - domain.com/somePrefix
Category Page - domain.com/somePrefix/currCategory/
Single Page   - domain.com/somePrefix/currCategory/singlePost/

If you install some kind of plugin like Yoast you'll be able to pick a "Primary" category for your permalink which is nice.

  • When doing this, I also get the /somePrefix/ base on the authors archive. How to solve this issue?
    – Sam
    Commented Feb 16, 2017 at 1:59
  • this will not work with subcategories
    – Tobias
    Commented May 18, 2021 at 11:49
  • @Tobias It should if the registere taxonomy rewrite has hierarchical set. See register_taxonomy()
    – Howdy_McGee
    Commented May 18, 2021 at 13:40

In the current WordPress version I set..

.. the permalinks to


.. the category base to


If I only used somePrefix (wihout /.) the posts itself couldn't be found

  • this will break all subcategory permalinks
    – Tobias
    Commented May 18, 2021 at 11:51
  • This works if you only use top-level categories, but it'll break pagination inside category archives. Commented Nov 11, 2021 at 18:37

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.