0

I have some products with categories that go 4 and sometimes 5 levels deep. The site will have an overview page for the first 2 levels. For example: my-website.com/category/subcategory

I have created a section called Product categories which has URL's enabled and links to a template. Can I prevent the deeper levels from having their own URL?

I thought about just returning a 404 inside the template when the level is higher than 2 but the sitemap will still include all these useless URL's.

Another option would be to create the main categories structure with max 2 levels and create another structure for the deeper levels which could be linked to each other. That way a product section would have a Category (first 2 levels) and a Type (deeper levels) field. The only problem here is that I don't want the Type field to contain all possible values. I want it to be filtered based on the chosen category.

Is one of these options possible?

1
  • 1
    Don't compromise your content model for the sake of a sitemap. If you really care that much about sitemaps (I don't believe you should), then amend your sitemap template to not output your level 3+ entries, and 301-redirect them to their parent. Commented Sep 1, 2023 at 8:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.