如何在Shopify商店中为特定页面添加noindex [英] How to Add noindex for specific page in Shopify store
本文介绍了如何在Shopify商店中为特定页面添加noindex的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个购物商店,我想用挡路搜索引擎来索引一些产品页面,我找到了这个解决方案https://help.shopify.com/en/manual/promoting-marketing/seo/hide-a-page-from-search-engines?utm_source=gurucopy&utm_medium=link&utm_campaign=Gurus#undefined
{% if handle contains 'page-handle-you-want-to-exclude' %}
<meta name="robots" content="noindex">
{% endif %}
但是我不知道应该如何修改我的挡路页面 在我的页面链接下方 mysite.com/products/product-26
mysite.com/products/Kalita
谢谢
推荐答案
有非常方便的方法可以做到这一点。它的作用就像一种护身符..您可以使用Shopify提供的产品的metafield属性(查找名为ShopifyFD for Google Chrome的工具)
为您要向Google隐藏的产品创建元字段。有一个元字段,名称空间为"seo",键为"Robots",并根据需要将值指定为"noindex"或"noindex,noollow",然后"保存"现在在Theme.Liquid in Head部分中,添加以下内容
{% if product and product.metafields.seo and product.metafields.seo.robots %}
<meta name="robots" content="{{ product.metafields.seo.robots }}">
{% endif %}
这篇关于如何在Shopify商店中为特定页面添加noindex的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文