FROM CACHE - en_header

Robots.txt and preventing pages from being indexed

Solved
Bernok
Shopify Partner
19 0 2

It is my understanding that it is not possible to edit the robots.txt file. The store I'm working on, uses multiple collections to sort items by price, alpha, and creation date. However, each of these pages gets indexed by google and other search engines. Example:

I'm sure someone has stumbled unto this before. How can I prevent these pages form being indexed?

 

Thanks,
B

Accepted Solution (1)

Accepted Solutions
Trevor
Community Moderator
Community Moderator
3243 439 790

This is an accepted solution.

Hello!

As of today, June 21st, 2021, we have launched the ability to edit the robot.txt file to give merchants more control over the information that is crawled by search engines. You can learn more about how to edit your robot.txt file through our community post here

Due to the age of the topic, I will be locking this thread and marking it as resolved to help direct anyone that lands on this page. If you have any questions about the new feature, please do not hesitate to create a new post under our "Techincal QA" board.

Trevor | Community Moderator @ Shopify Out of Office Nov 18th - Nov 27th
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Replies 3 (3)
Jason
Shopify Expert
10959 196 2212

Use Meta Tags:

The noindex meta standard is useful if you don't have root access to your server, as it allows you to control access to your site on a page-by-page basis.

http://support.google.com/webmasters/bin/answer.py?hl=en&answer=93710

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
Bernok
Shopify Partner
19 0 2

Perfect! I already had the meta tag by default on all pages. I ended up doing this instead:

{% if collection.handle contains '-sort' %}
  <meta name="robots" content="noindex">
{% else %}
  <meta name="robots" content="index,follow">
{% endif %}

Thank you!

 

Edit: Fixed the code.

Trevor
Community Moderator
Community Moderator
3243 439 790

This is an accepted solution.

Hello!

As of today, June 21st, 2021, we have launched the ability to edit the robot.txt file to give merchants more control over the information that is crawled by search engines. You can learn more about how to edit your robot.txt file through our community post here

Due to the age of the topic, I will be locking this thread and marking it as resolved to help direct anyone that lands on this page. If you have any questions about the new feature, please do not hesitate to create a new post under our "Techincal QA" board.

Trevor | Community Moderator @ Shopify Out of Office Nov 18th - Nov 27th
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog