-1

I have the following category hierarchy:

-Cat
--SubCat
---SubSubCat

When creating an post and mark it only in the subsubcat category, the correct slug is generated: www.example.com/cat/subcat/subsubcat/post-title

When creating an post and mark it in the subcat and subsubcat categories, the slug is generated by subtracting the grandchild category: www.example.com/cat/subcat/post-title

This is the normal operation of Wordpress or would it be a bug?

My permalink configuration is custom structure: enter image description here

BobGCA2
  • 125
  • 10

1 Answers1

1

This article describes the behavior of Wordpress with respect to categories, sub-categories, and sub-sub-categories.

According to them,

Another scenario is when you have a parent category, subcategory, and a sub-subcategory. WordPress will include all three of them in the URL.

http://example.com/apple/technology/events/article-title-here/

So you should be able to see all categories correctly nested. Check that you've configured your slug generation correctly. Also, check with Wordpress Stack Exchange.

Community
  • 1
  • 1
David Brossard
  • 13,584
  • 6
  • 55
  • 88
  • The slug is set correctly, as per the image I added now. Only include the 3 in the url if only `subsubcat` is checked (leaving the `cat` and `subcat` boxes unchecked). The problem is, I'm displaying related posts by category and I need to check the parent category to display them. – BobGCA2 Oct 23 '19 at 23:01
  • That sounds like a related post plugin issue more so now... Are you using Jetpack or a dedicated plugin? – David Brossard Oct 23 '19 at 23:04
  • Not! I only use 6 plugins (Akismet Anti-Spam, Google XML Sitemaps, AMP, Classic Editor, KK Star Ratings, and WP Fatest Cache). – BobGCA2 Oct 23 '19 at 23:20
  • Strangely enough, the `subsubcat` is only subtracted from the slug that is generated on the classic editor screen when we publish or update the post. But on the homepage the links are complete. – BobGCA2 Oct 23 '19 at 23:31
  • 1
    It might well be that multiple links are valid. It's worth filing a bug with wpress directly – David Brossard Oct 23 '19 at 23:39
  • 1
    Thanks for pointing the way I'll register the bug and as soon as you have answer I'll be back to update. – BobGCA2 Oct 30 '19 at 00:43