I have a wordpress site where the category base is stripped from the url.
Now, when a category has a certain slug that's similar to a post slug, the category is shown.
I would like to show the post instead. Is this possible?
I think you can use the answer to this question by replacing
There isn't a clean way to do what you're asking. What you want is for WordPress to check to see if, for a given URL, there is a post with that slug, and if not, try to find a category with that slug. With the exception of pages, WordPress doesn't check to see if an opject (post, term) exists before "committing" to a matching rewrite rule. Therefore, when you have conflicting rewrite rules, the second one will never be read.
The best answer is to find a different rewrite structure for your posts or categories. Prefixes are ideal, like
That said, it's not impossible to do what you're asking, it's just not optimal. What you need to do is intercept the