The Moz Q&A Forum

    • Forum
    • Questions
    • My Q&A
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. SEO and Digital Marketing Q&A Forum
    2. Categories
    3. Technical SEO Issues
    4. Rel canonical with index follow on query string URLs

    Rel canonical with index follow on query string URLs

    Technical SEO Issues
    4 3 1.4k
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • panini
      panini last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • oznappies
        oznappies last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • RyanKent
          RyanKent last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • panini
            panini last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            • URL with query string being indexed over it's parent page?
              Zohaibkhannn
              Zohaibkhannn
              0
              3
              59

            • Is rel=canonical needed for URLs with Google Analytics query strings?
              ThompsonPaul
              ThompsonPaul
              0
              4
              1.9k

            • Writing of url query strings to be seo frinedly
              smarties954
              smarties954
              0
              2
              2.0k

            • No indexing url including query string with Robots txt
              HMK-NL
              HMK-NL
              0
              7
              19.2k

            • Canonical solution for query strings?
              Saijo.George
              Saijo.George
              0
              6
              2.4k

            • URL query strings and canonical tag
              bizarro1000
              bizarro1000
              0
              3
              6.5k

            • Rel=Canonical to Rewrite or original URL?
              PathInteractive
              PathInteractive
              0
              3
              994

            • Rel canonical or 301 the Index Page?
              KeriMorgret
              KeriMorgret
              0
              8
              1.4k

            Get started with Moz Pro!

            Unlock the power of advanced SEO tools and data-driven insights.

            Start my free trial
            Products
            • Moz Pro
            • Moz Local
            • Moz API
            • Moz Data
            • STAT
            • Product Updates
            Moz Solutions
            • SMB Solutions
            • Agency Solutions
            • Enterprise Solutions
            • Digital Marketers
            Free SEO Tools
            • Domain Authority Checker
            • Link Explorer
            • Keyword Explorer
            • Competitive Research
            • Brand Authority Checker
            • Local Citation Checker
            • MozBar Extension
            • MozCast
            Resources
            • Blog
            • SEO Learning Center
            • Help Hub
            • Beginner's Guide to SEO
            • How-to Guides
            • Moz Academy
            • API Docs
            About Moz
            • About
            • Team
            • Careers
            • Contact
            Why Moz
            • Case Studies
            • Testimonials
            Get Involved
            • Become an Affiliate
            • MozCon
            • Webinars
            • Practical Marketer Series
            • MozPod
            Connect with us

            Contact the Help team

            Join our newsletter
            Moz logo
            © 2021 - 2026 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
            • Accessibility
            • Terms of Use
            • Privacy