You may have been there. You are reading a tutorial on an established WordPress site and something catches your eye. Something that you question because recently you were working on your own site and this exact situation was part of your issue, but you find that what they are saying is wrong. I can only guess that maybe it has happened here on my site as well. In any case, this is what I read:
If you choose to file a post under the child category but not under the parent category, your post will appear only on the archive pages of child category. This is particularly helpful when you want to avoid duplicate content.
No, I thought. That isn’t right. So I have to prove it to myself because as I mentioned, I was just working on something that directly relates to this.
Creating a Sub-Category in WordPress for a Reason
Now when you create a category in WordPress, it lets you choose if that category has a parent or not. (As you know, parent category and child category equates to category and sub-category.)
You might create a category called photography:
For various reasons, you may create sub-categories of children, wedding, and family:
Now you have your parent category with your nested child categories. All is good.
Now I will admit it had been awhile since I used child categories. And I thought the results would be exactly like those appearing on that other site, which, as you recall, said:
If you choose to file a post under the child category but not under the parent category, then your post will appear only on the archive pages of child category. This is particularly helpful when you want to avoid duplicate content.
So according to this and what many believe, if I were to create a post and assign it only to the child category family, it will not appear on the category archive page of photography, the parent page.
I did just that.
I created a post and assigned it only to the category family.
Now if I click on the category archive for family, it should be there. And sure enough, it is.
And if I click on the category photography archive, well, in a perfect world it wouldn’t show up. But, there the sucker is.
My Single, Important Tip on Categories
At this point it should be obvious, but never assume that by assigning a post to a child category only, that it won’t show up in the parent category, thus duplicating the post and likely not doing what was intended it to do.
That is all.