Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hello,
Using Dawn 13.0, no custom theme, all default store build.
I have built a structure of simple shopify pages. Around 75 or so. I need to point them all to the parent page, which is the only relevant page to be indexed (duplicate data on the others(SEO)).
Parent page to index:
https://www.iamgreenminded.com/pages/shade-selector
75 pages to point canonical to parent above, look like this:
https://www.iamgreenminded.com/pages/shade-selector-medium-light
https://www.iamgreenminded.com/pages/shade-selector-mediumlight-olive
2 questions:
1. I understand using the canonical syntax on these pages would be best practice? <link rel="canonical" href="https://www.iamgreenminded.com/pages/shade-selector/" />
Other option I hear is robots?
2. If canonical is the correct option , I assume I need to put this in the head of the pages
how do I do this properly on shopify?
Thank you.
Solved! Go to the solution
This is an accepted solution.
Nope. These pages have different content, so canonical is not applicable here. Canonical is used for pages with identical content.
For example -- when product belongs to 5 collections there are 5 collection-aware URLs pointing to this product page and one collection-less link. But the product page is the same -- this is where you'd use canonical.
See https://www.semrush.com/blog/canonical-url-guide/
If your want to hide those pages from search bots, then yes, you can use robots.txt, or, alternatively, you can set a metafield on these page objects.
Check https://community.shopify.com/c/shopify-discussions/hide-a-product-from-seo-and-from-the-shopify-fro... -- it talks about products, but you can do the same with pages.
When metafield is set to 1, these pages
And no need to modify your theme.
Hi @surfingcinv ,
Using canonical tags is indeed the best practice in this scenario. Canonical tags inform search engines that a particular page is the preferred version among a set of duplicate pages, ensuring that your SEO efforts are concentrated on the parent page.
This seems to be a custom request. We can make the use of metafield to store canonical tags for each page. For this we will have to make changes on the theme. Do you have any experiance creating a meta field? If yes, I can provide a step by step instrutions on how to get this done.
Thank you
Hi @surfingcinv
You can add this code before closing head tag </head>
{% if page.handle contains "shade-selector" %}
<link rel="canonical" href="https://www.iamgreenminded.com/pages/shade-selector/" />
{% endif %}
It will set same canonicals to all pages that has shade-selector in handle
For more advance conditions, You can use metafields
Please check if it is helpful to you
Thanks!
Great. Can you tell me where/what file to put this code in?
Please put in theme.liquid before closing head tag </head>
Thanks
This is an accepted solution.
Nope. These pages have different content, so canonical is not applicable here. Canonical is used for pages with identical content.
For example -- when product belongs to 5 collections there are 5 collection-aware URLs pointing to this product page and one collection-less link. But the product page is the same -- this is where you'd use canonical.
See https://www.semrush.com/blog/canonical-url-guide/
If your want to hide those pages from search bots, then yes, you can use robots.txt, or, alternatively, you can set a metafield on these page objects.
Check https://community.shopify.com/c/shopify-discussions/hide-a-product-from-seo-and-from-the-shopify-fro... -- it talks about products, but you can do the same with pages.
When metafield is set to 1, these pages
And no need to modify your theme.
Thanks. This looks like the right solution in this case. I pasted detailed instructions for anyone else trying to do this for shopify (PAGES)
Shopify Admin dashboard, go to your pages and select the page you wish to hide from search engines.
Once on your product page, scroll to the very bottom.
You’ll now see the metafield you’ve added.
The end result is that particular page will be removed from search engines. You can verify this by right clicking on the page and selecting View Source. Look for robots and you should see in the code that it now says:
<meta name="robots" content="noindex,nofollow" />
By 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, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024