Rel canonical with index follow on query string URLs
-
Hi guys,
Quick question regarding the rel canonical tag.
I have lots of links pointing at me with query strings and previously used some code to determine if query strings were in the URL and if they were then not to index that page. If there weren't query strings then the page would be indexed and followed.
I assume I can now use the rel canonical tag on each of these pages so the value goes to the proper URL minus any query string. However do I need to have the rel canonical tag above the index, follow tag on the page?
So URL is site.com/page.html?ref=ABC
meta robots is "index, follow"
Rel canonical is "site.com/page.html"
Does the order of the meta robots and canonical tag matter?
Thanks in advance!
-
Thanks for the responses guys.
@oznappies: I'll have the canonical line at the top for best practices and so it's visible.
@Ryan - My CMS has the option to noindex/nofollow too as there are some pages we don't want indexed. Thanks for the heads up about the WMT/Bing method though.
-
Hi Panini.
The location of the canonical tag does not matter as long as it is somewhere within the tags.
A couple extra notes:
-
the "index, follow" tag is not required. That is the default behavior of crawlers. I would suggest not adding that information as it is unnecessary code
-
you can specify in Google Webmaster Tools how you wish parameters to be treated. From your WMT dashboard > Site Configurations > Settings > Parameter handling tab. Bing has a similar setting in their webmaster's tools section.
-
-
It shouldn't, but I would always place rel canonical as the first line to ensure that it is indexed first and all references are relative to that. This is a developer preference as it is a good design practice. This works on pages we host and create. You should also inform webmaster tool of any parameters you use and to ignore them,even though you have the rel canonical.
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
URL Indexed But Not Submitted to Sitemap
Hi guys, In Google's webmaster tool it says that the URL has been indexed but not submitted to the sitemap. Is it necessary that the URL be submitted to the sitemap if it has already been indexed? Appreciate your help with this. Mark
Technical SEO | | marktheshark100 -
Canonical vs 301 for index.php
Hello, we found recently quite a big error our index.php file had no canonical tag nor was a 301 redirect. So we put a canonical tag to it that it's the main www.examle.com duplicate . Now is there any difference in regards to link juice or Google 301 vs canonical tag ? I read that moz did a 301 from their index php. I understand one difference is that user then can Type in the URL if no 301, but I'm interested about ranking effect of it.
Technical SEO | | advertisingcloud0 -
Any SEO-wizards out there who can tell me why Google isn't following the canonicals on some pages?
Hi, I am banging my head against the wall regarding the website of a costumer: In "duplicate title tags" in GSC I can see that Google is indexing a whole bunch parametres of many of the url's on the page. When I check the rel=canonical tag, everything seems correct. My costumer is the biggest sports retailer in Norway. Their webshop has approximately 20 000 products. Yet they have more than 400 000 pages indexed by Google. So why is Google indexing pages like this? What is missing in this canonical?https://www.gsport.no/herre/klaer/bukse-shorts?type-bukser-334=regnbukser&order=price&dir=descWhy isn't Google just cutting off the ?type-bukser-334=regnbukser&order=price&dir=desc part of the url?Can it be the canonical-tag itself, or could the problem be somewhere in the CMS? Looking forward to your answers Sigurd
Technical SEO | | Inevo0 -
Canonical URLs in an eCommerce site
We have a website with 4 product categories (1. ice cream parlors, 2. frozen yogurt shops etc.). A few sub-categories (e.g. toppings, smoothies etc.) and the products contained in those are available in more than one product category (e.g. the smoothies are available in the "ice cream parlors" category, but also in the "frozen yogurt shops" category). My question: Unfortunately the website has been designed in a way that if a subcategory (e.g. smoothies) is available in more than 1 category, then itself (the subcategory page) + all its product pages will be automatically visible under various different urls. So now I have several urls for one and the same product: www.example.com/strawberry-smoothie|SMOOTHIES|FROZEN-YOGURT-SHOPS-391-2-5 and http://www.example.com/strawberry-smoothie|SMOOTHIES|ICE-CREAM-PARLORS-391-1-5 And also several ones for one and the same sub-category (they all include exactly the same set of products): http://www.example.com/SMOOTHIES-1-12-0-4 (the smoothies contained in the ice cream parlors category) http://www.example.com/SMOOTHIES-2-12-0-4 (the same smoothies, contained in the frozen yogurt shops category) This is happening with around 100 pages. I would add canonical tags to the duplicates, but I'm afraid that by doing so, the category (frozen yogurt shops) that contains several non-canonical sub-categories (smoothies, toppings etc.) , might not show up anymore in search results or become irrelevant for Google when searching for example for "products for frozen yoghurt shops". Do you know if this would be actually the case? I hope I explained it well..
Technical SEO | | Gabriele_Layoutweb0 -
Why does my mobile site have a "?mobiRedirect=1" string at the end of the URL?
Hello, When trying to access my site from a smart-phone, I'm getting a redirected to the mobile version (which is correct), however at the end of the URL there is a redirect string that shows every time. I'm not sure why its its showing or how it automatically gets appended to the end of the URL each time. How can I configure my mobile site to prevent the ?mobiRedirect=1" from showing? For example, if you search for "Columbus Regional Health" on Google with a smart-phone, the first result should be for www.crh.org. If you click that, you should get redirected to www.crh.org/mobile , however its displaying the URL as http://www.crh.org/mobile/default.aspx?mobiRedirect=1 Does anyone know how to fix this? Thank you,
Technical SEO | | Liamis
Brian0 -
Is rel=canonical needed for URLs with Google Analytics query strings?
If a page URL has Google Analytics query strings, does the page need a canonical tag? e.g., something.com/?utm_source=newsletter&utm_campaign=mar-2013-nsl I have rel=canonical on all our pages because some of them will be accessed via URLs that have non-Google strings. The strings are only for marketing purposes, not for identifying a specific page to display. e.g., something.com/?source=acme Should I only implement the canonical tag on the pages that might have non-Google marketing strings in the URL?
Technical SEO | | WayneBlankenbeckler0 -
How I implement the cross domain rel canonical?
I just watched the WBF on cross domain rel canonicals. I understand the concept, but not sure how I go about actually doing the rel canonical? If I have www.mysite.com and someone we just partnered with, www.othersite.com wants to create new pages and use my content, what will the rel canonical tag look like on www.othersite.com? Do I need to also put this tag on www.mysite.com? I want to make sure each of my pages that the other site is copying is getting the "SEO credit."
Technical SEO | | NueMD0 -
How to handle sitemap with pages using query strings?
Hi, I'm working to optimize a site that currently has about 5K pages listed in the sitemap. There are not in face this many pages. Part of the problem is that one of the pages is a tool where each sort and filter button produces a query string URL. It seems to me inefficient to have so many items listed that are all really the same page. Not to mention wanting to avoid any duplicate content or low quality issues. How have you found it best to handle this? Should I just noindex each of the links? Canonical links? Should I manually remove the pages from the sitemap? Should I continue as is? Thanks a ton for any input you have!
Technical SEO | | 5225Marketing0