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

Firstly my problem was the %tag% in the permalink, but I resolved it with this patch:
%tag% in permalink not working

So my custom structure now looks like this:


And the url is like:


However, now I have something else that I can't resolve. When post doesn't have any tag the url becomes:


.. which is undesired.

If post does'nt have tags, i would like the url to be..


and if it does..


Anyone have an idea how to solve this?

share|improve this question

I don't think there is an easy way to solve this, because /some-category/some-tag/ will be used as an overview page for all posts in category some-category and with tag some-tag. If an URL like /cocktails/bloody-mary/ comes in for a post with the name bloody-mary, category cocktails and no tags, WordPress can't split it up correctly because at that time it does not know that bloody-mary is not a tag, and should thus be a post name.

The best solution is to use a fixed string when there is no tag (untagged, like uncategorized is what I used in my answer to your related question).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.