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
-
How handle pages with "read more" text query strings?
My site has hundreds of keyword content landing pages that contain one or two sections of "read more" text that work by calling the page and changing a ChangeReadMore variable. This causes the page to currently get indexed 5 times (see examples below plus two more with anchor tag set to #sectionReadMore2 This causes Google to include the first version of the page which is the canonical version and exclude the other 4 versions of the page. Google search console says my site has 4.93K valid pages and 13.8K excluded pages. My questions are: 1. Does having a lot of excluded pages which are all copies of included pages hurt my domain authority or otherwise hurt my SEO efforts? 2. Should I add a rel="nofollow" attribute to the read more link? If I do this will Google reduce the number of excluded pages? 3. Should I instead add logic so the canonical tag displays the exact URL each time the page re-displays in another readmore mode? I assume this would increase my "included pages" and decrease the number of "excluded pages". Would this somehow help my SEO efforts? EXAMPLE LINKS https://www.tpxonline.com/Marketplace/Used-AB-Dick-Presses-For-Sale.asp https://www.tpxonline.com/Marketplace/Used-AB-Dick-Presses-For-Sale.asp?ChangeReadMore=More#sectionReadMore1 https://www.tpxonline.com/Marketplace/Used-AB-Dick-Presses-For-Sale.asp?ChangeReadMore=Less#sectionReadMore1
Technical SEO | | DougHartline0 -
Adding a parameter to the URL / URL Stracture
Dear Community, I would like to ask a question regarding url structure. We are struggling with shorting urls and we thought to add a "parameter" to the url. Example: domain.com/product**/a/** or domain.com**/a/**product/ Current url structure: domain.com/product/ So we go after and short url contains "/a/" and find the category we want. Is this going to harm our SEO strategies? Any idea is welcome.
Technical SEO | | geofil0 -
404 or rel="canonical" for empty search results?
We have search on our site, using the URL, so we might have: example.com/location-1/service-1, or example.com/location-2/service-2. Since we're a directory we want these pages to rank. Sometimes, there are no search results for a particular location/service combo, and when that happens we show an advanced search form that lets the user choose another location, or expand the search area, or otherwise help themselves. However, that search form still appears at the URL example.com/location/service - so there are several location/service combos on our website that show that particular form, leading to duplicate content issues. We may have search results to display on these pages in the future, so we want to keep them around, and would like Google to look at them and even index them if that happens, so what's the best option here? Should we rel="canonical" the page to the example.com/search (where the search form usually resides)? Should we serve the search form page with an HTTP 404 header? Something else? I look forward to the discussion.
Technical SEO | | 4RS_John1 -
Not All Submitted URLs in Sitemap Get Indexed
Hey Guys, I just recognized, that of about 20% of my submitted URL's within the sitemap don't get indexed, at least when I check in the webmaster tools. There is of about 20% difference between the submitted and indexed URLs. However, as far as I can see I don't get within webmaster tools the information, which specific URLs are not indexed from the sitemap, right? Therefore I checked every single page in the sitemap manually by putting site:"URL" into google and every single page of the sitemap shows up. So in reality every page should be indexed, but why does webmaster tools shows something different? Thanks for your help on this 😉 Cheers
Technical SEO | | _Heiko_0 -
Implement rel canonical on a Blogspot blog
Does anyone know how to implement a rel canonical tag on a Blogspot blog? I am trying to pass link juice from an old Blogspot blog to a self-hosted website.
Technical SEO | | ProjectLabs0 -
Does Google follow a text based URL with no anchor tags?
I am seeing with Webmaster Tools that Google is trying to follow the text based truncated URL from SuperPages despite the fact that they are not in an anchor tag. The net result for Google is a 404 error as they try to access pages that do not exist. has anyone seen this issue before and any suggestions on how to prevent these errors? A Superpage listing: The first link works fine, but the text based link shown below is cut off and as a result Google gets to a 404 page. http://swbd-out.superpages.com/webresults.htm?qkw=dr+hylton+lightman&qcat=web&y=0&x=0& Dr. Hylton Lightman, MD - Pediatrician, Allergist, - Far Rockaway ... Dr. Hylton Lightman, MD, Far Rockaway, NY, Rated 4/4 By Patients. 26 Reviews, Patients' Choice Award Winner, Phone Number & Practice Locations www.vitals.com/doctors/Dr_Hylton_Lightma... [Found on Bing]
Technical SEO | | irvingw0 -
Rel - canonical vs 301 redirect
I have multiple product pages on my site - what is better for rankings in your experiance? If I 301 the pages to 1 correct version of the product page - or if I rel caanonical to the one correct page?
Technical SEO | | DavidS-2820610 -
Best usage of rel canonical in case of pagination for content list ?
I've looked at most of the question in the Q&A who speak about pagination but didn't find a clear answer to my concern. So here is my question : On the website i work for, we have list of recipes with this info for each recipe : picture, title, type, difficulty, time and author. 10 recipes per pages and X pages for each list. Would you use link rel canonical on page X with first page as value ? (i've seen this answer in one question here)
Technical SEO | | kr0hmy
Or canonicalize to page X keeping each page of the list in the index ?
Would the content be seen as duplicate if we don't use rel canonical and just add page X in the title? Or would it be unique enough with all the infos? Thanks for your help on this !0