Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi fellow Shopifyers
I have an issue with Google crawling thousands of non-canonical URLs rather than spending what little juice they have on crawling the URLs that are actually valuable. I've spent some time looking through everything on Search Console and I believe I have located the different sources of the various URL's. However, I need some help in figuring out how to tell Google not to crawl these pages. Do I need to add some code snippet to Theme.liquid or can it be using Robots.txt?
The things I wish to exclude are URLs containing:
I've managed to find a code snippet which should exclude the URLs excluded by the Search function, but can this be modified to exclude the above functions as well?
{% if template contains 'search' %}
<meta name="robots" content="noindex">
{% endif %}
You create a new robots.txt.liquid template. It's becomes an "add-on" to the existing default robots.txt created by Shopify.
Read this for more details: https://help.shopify.com/en/manual/promoting-marketing/seo/editing-robots-txt
In the robots.txt.liquid, embed before
{%- if group.sitemap != blank -%}
{{ group.sitemap }}
{%- endif -%}
{% endfor %}
the following (or any others):
Disallow: *?page=*
Disallow: *?pr_prod_strat=*
After you save, the final robots.txt should exclude those pages.
Thank you for your response!
Before going ahead and implementing this, do you know if there can be any negative impacts from exluding those pages from Crawling? Is there a benefit in letting google crawl filter, search and recommended products as well?
There is no negative impact from excluding those pages. Google wants only unique pages on search results. In this case, you want to show each individual product page as it is. Those URLs are created based on users' interaction with your website and has no added value.
Let's say, a filtered page - it means there is a specific groups of products - instead of indexing that page, it might be worthwhile to create a collection page instead to highlight that group of products and their distinct characteristics. You can also work on the SEO of that collection page by writing good meta description and in the long term get that collections page to rank higher on Google.
If there is a group of people looking for those (grouped) products, Google will show them that collection page. It's a more sophisticated solution and benefits the overall SEO of your store too.
I found
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024