How to add "no index" code to a duplicate product page

Hi, appreciate your help in advance. I need to duplicate a product so I have 2 product pages for the same product. There will be some very minor changes and this page will only be provided via direct links and won’t be visible on the main site. However, in order to do this I would want to add “no index” code so that the search engines don’t index this page or penalize me for duplicate content. Is there any way to add the necessary “no index” code to a page in shopify? Thank you for the help! David

Hello @davidv42

Welcome to Shopify community.

Yes it is possible to add noindex in theme.liquid file.

Open code editor > theme.liquid.

Search for tag.

Add the below code.

{% if product.id == ID %}

{% endif %}

Please replace the ID with your duplicate product id.

Thanks

Thank you for your help! Really appreciate it. I will give this a try!