Jump to content

Identify if Category is Parent or Child


Recommended Posts

I have a website that is currently having over 350 categories including subcategories in its category tree. Its a lot of categories but it is necessary and it gives the user a good user experience in this specific case for this shop.


The problem is that Google does not really like having 350 links on every page. I would like to solve this without removing the links (Because for the user experience, it is working well with displaying all these subcategories in the category tree).


What I want to do is something like this:

if(category is parent){
print category with normal HTML
print category using javascript (To hide from Google)



This would make all parents be crawlable for Google and Google could then crawl each subcategory after visiting each parent category. But Google would not identify 350 links on the landing page.


My question is:

How do I identify if a Category is a parent or a child? Another thing that would be usefull would also be to know how to identify if the category is the active category right now.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...