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. Disallow wildcard match in Robots.txt

    Disallow wildcard match in Robots.txt

    Technical SEO Issues
    3 3 1.0k
    • 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.
    • AmandaBridge
      AmandaBridge last edited by

      This is in my robots.txt file, does anyone know what this is supposed to accomplish, it doesn't appear to be blocking URLs with question marks

      Disallow: /?crawler=1
      Disallow: /
      ?mobile=1

      Thank you

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

        Hi Amanda,

        Those lines tell GoogleBot not to crawl urls that have that text fragments.
        For example, wont crawl: domain.com/category/product**?mobile=1**

        BUT, that doesnt mean that will not crawl every URL with question marks. For that, the line should be like this:
        Disallow: /*?

        I do highly recommend you to read this guides:
        About /robots.txt - Official site - Robotstxt.org
        Robots.txt - Moz
        Robots.txt: the ultimate guide - YOAST
        The Complete Guide to Robots.txt - PORTENT

        Hope it helps.
        Best luck.
        GR

        effectdigital 1 Reply Last reply Reply Quote 1
        • effectdigital
          effectdigital @GastonRiera last edited by

          This is a good reply.

          Everyone gets really confused because Robots.txt has very minor, partial wildcard support and that makes people think that Robots.txt files use Regex, which they do not. Instead of having some weird half and half implementation, it would be much better IMO if the Robots.txt initiative / directive were updated to say "yes, you can use full regular expressions with regards to URL string matching".

          Many people are left in a kind of silly guessing game because Google doesn't 'properly' elaborate or invest in expanding the definitions to their currently (publicly) assumed end-game.

          People assume that if "*" will match any string of characters, "?" will match any individual character when used in a robots.txt file. This would make sense, but it's not the case. AFAIK there are only one or two supported wildcard characters in Robots.txt and that's why people get confused, looking for escape characters and the suchlike.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          • Robots.txt Disallow: / in Search Console
            GastonRiera
            GastonRiera
            0
            2
            124

          • Does putting Disallow: / at the end of a robots.txt file override the Allow: /xxxx that come before it?
            Alick300
            Alick300
            0
            4
            249

          • Will a robots.txt disallow apply to a 301ed URL?
            Martijn_Scheijbeler
            Martijn_Scheijbeler
            0
            3
            158

          • Googlebot does not obey robots.txt disallow
            Cyrus-Shepard
            Cyrus-Shepard
            0
            12
            1.4k

          • Allow or Disallow First in Robots.txt
            Net66SEO
            Net66SEO
            0
            12
            27.8k

          • How long does it take for traffic to bounce back from and accidental robots.txt disallow of root?
            EricaMcGillivray
            EricaMcGillivray
            0
            2
            640

          • Does RogerBot read URL wildcards in robots.txt
            jennita
            jennita
            0
            2
            928

          • Robots.txt and robots meta
            TheEspresseo
            TheEspresseo
            0
            5
            1.1k

          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