0

How to I add a noindex tag to pagination pages for categories in Shopify? I've found apps that claim to do it, but I believe it should be able I can do without an app.

Thanks

Doyley
  • 331
  • 1
  • 4
  • 17

2 Answers2

0

You need to know which template to target, usually templates that have pagination in Shopify are: collection, blog, search.

So you should be able to do something like this in theme.liquid:

{% if template.name == "collection" or
  template.name == "blog"
%}
  <meta name="robots" content="noindex, nofollow" />
{% endif %}

This ^ is very generic so if you want to be more specific, you can check for the page object (collection, product, page, blog, article, etc...) handle:

{% if collection.handle == "example" or
  page.handle == "example" or
  blog.handle == "example"
%}
  <meta name="robots" content="noindex, nofollow" />
{% endif %}
Dharman
  • 30,962
  • 25
  • 85
  • 135
Karim Tarek
  • 797
  • 4
  • 18
0

It would be better to let Google crawl pagination URLs, using a self referencing canonical for each. As soon as you add nofollow you block the bots. That can cause problems.

Mick
  • 1