How can I delete unused collection pages from my Be Yours theme?

Hello, I do not use my collection page(s) but Shopify creates them and Google crawls the pages. How do I remove them so the url’s won’t be crawled messing with my SEO. Below are the collection page urls I am trying to remove. Thanks.

https://backnineskincare.com/collections; and

https://backnineskincare.com/collections/all

Thanks!

1 Like

Depending on your theme, you can delete the

  • /templates/collection.json and
  • /templates/list-collections.json

This will result in 404 being generated when mentioned URLs are requested so you should either amend your 404 page to cater for this or setup 301 redirects https://help.shopify.com/en/manual/online-store/menus-and-links/url-redirect (ignore the part about unable to redirect some paths – you now can because of 404 generated).

Finally, you may want to create a robots.txt to prevent robots from trying to index those pages.

Refer to, say https://help.shopify.com/en/manual/promoting-marketing/seo/editing-robots-txt and https://logeix.com/shopify-seo/robots-txt for further info.

And MAKE A THEME DUPLICATE before you approach any of these.

1 Like

Hi [email removed]

You can try this code to theme.liquid

{% if handle contains "all" or template contains "list-collections" %}
      
    {% endif %}

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Hello @Back9ine

  • If you want to prevent search engines from crawling these URLs, you can add specific rules to your robots.txt file.
  • Open your Shopify admin and go to “Online Store” > “Themes.”
  • Click on “Actions” and then select “Edit code.”
  • Look for or create a robots.txt file and add the following lines:

User-agent: *
Disallow: /collections

Hi Tim, the above partially worked.

My URL redirect doesn’t work for https://backnineskincare.com/collections since the page appears to still be active. Is there a way to fully delete this page? Thanks.