undefined
Skip to content
Moz logo Menu open Menu close
  • Products
    • Moz Pro
    • Moz Pro Home
    • Moz Local
    • Moz Local Home
    • STAT
    • Moz API
    • Moz API Home
    • Compare SEO Products
    • Moz Data
  • Free SEO Tools
    • Domain Analysis
    • Keyword Explorer
    • Link Explorer
    • Competitive Research
    • MozBar
    • More Free SEO Tools
  • Learn SEO
    • Beginner's Guide to SEO
    • SEO Learning Center
    • Moz Academy
    • SEO Q&A
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • Case Studies
    • The Moz Story
    • New Releases
  • Log in
  • Log out
  • Products
    • Moz Pro

      Your all-in-one suite of SEO essentials.

    • Moz Local

      Raise your local SEO visibility with complete local SEO management.

    • STAT

      SERP tracking and analytics for enterprise SEO experts.

    • Moz API

      Power your SEO with our index of over 44 trillion links.

    • Compare SEO Products

      See which Moz SEO solution best meets your business needs.

    • Moz Data

      Power your SEO strategy & AI models with custom data solutions.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Free SEO Tools
    • Domain Analysis

      Get top competitive SEO metrics like DA, top pages and more.

    • Keyword Explorer

      Find traffic-driving keywords with our 1.25 billion+ keyword index.

    • Link Explorer

      Explore over 40 trillion links for powerful backlink data.

    • Competitive Research

      Uncover valuable insights on your organic search competitors.

    • MozBar

      See top SEO metrics for free as you browse the web.

    • More Free SEO Tools

      Explore all the free SEO tools Moz has to offer.

    NEW Keyword Suggestions by Topic
    Moz Pro

    NEW Keyword Suggestions by Topic

    Learn more
  • Learn SEO
    • Beginner's Guide to SEO

      The #1 most popular introduction to SEO, trusted by millions.

    • SEO Learning Center

      Broaden your knowledge with SEO resources for all skill levels.

    • On-Demand Webinars

      Learn modern SEO best practices from industry experts.

    • How-To Guides

      Step-by-step guides to search success from the authority on SEO.

    • Moz Academy

      Upskill and get certified with on-demand courses & certifications.

    • MozCon

      Save on Early Bird tickets and join us in London or New York City

    Unlock flexible pricing & new endpoints
    Moz API

    Unlock flexible pricing & new endpoints

    Find your plan
  • Blog
  • Why Moz
    • Small Business Solutions

      Uncover insights to make smarter marketing decisions in less time.

    • Agency Solutions

      Earn & keep valuable clients with unparalleled data & insights.

    • Enterprise Solutions

      Gain a competitive edge in the ever-changing world of search.

    • The Moz Story

      Moz was the first & remains the most trusted SEO company.

    • Case Studies

      Explore how Moz drives ROI with a proven track record of success.

    • New Releases

      Get the scoop on the latest and greatest from Moz.

    Surface actionable competitive intel
    New Feature

    Surface actionable competitive intel

    Learn More
  • Log in
    • Moz Pro
    • Moz Local
    • Moz Local Dashboard
    • Moz API
    • Moz API Dashboard
    • Moz Academy
  • Avatar
    • Moz Home
    • Notifications
    • Account & Billing
    • Manage Users
    • Community Profile
    • My Q&A
    • My Videos
    • Log Out

The Moz Q&A Forum

  • Forum
  • Questions
  • Users
  • Ask the Community

Welcome to the Q&A Forum

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

  1. Home
  2. SEO Tactics
  3. Intermediate & Advanced SEO
  4. Robots.txt & Disallow: /*? Question!

Moz Q&A is closed.

After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.

Robots.txt & Disallow: /*? Question!

Intermediate & Advanced SEO
7
6
1.7k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as question
Log in to reply
This topic has been deleted. Only users with question management privileges can see it.
  • vetofunk
    vetofunk last edited by Feb 25, 2019, 3:38 PM

    Hi,

    I have a site where they have:

    Disallow: /*?

    Problem is we need the following indexed:

    ?utm_source=google_shopping

    What would the best solution be? I have read:

    User-agent: *
    Allow: ?utm_source=google_shopping
    Disallow: /*?

    Any ideas?

    1 Reply Last reply Reply Quote 0
    • BabaBha0173
      BabaBha0173 last edited by Mar 30, 2020, 5:48 AM Mar 30, 2020, 5:48 AM

      User-agent: * Disallow: /cgi-bin/ Disallow: /wp-admin/ Disallow: /archives/ Disallow: /? Allow: /comments/feed/ Disallow: /refer/ Disallow: /index.php Disallow: /wp-content/plugins/ Allow: /wp-admin/admin-ajax.php User-agent: Mediapartners-Google* Allow: / User-agent: Googlebot-Image Allow: /wp-content/uploads/ User-agent: Adsbot-Google Allow: / User-agent: Googlebot-Mobile Allow: / Sitemap: https://site.com/sitemap_index.xml

      use this it will help you and your problem will solve

      Regards

      Chotapao

      1 Reply Last reply Reply Quote 0
      • topic:timeago_earlier,4 months
      • Hoslaa
        Hoslaa @SAjad687 last edited by Dec 4, 2019, 1:57 PM Dec 4, 2019, 1:57 PM

        User-agent: * Disallow: /cgi-bin/ Disallow: /wp-admin/ Disallow: /archives/ Disallow: /? Allow: /comments/feed/ Disallow: /refer/ Disallow: /index.php Disallow: /wp-content/plugins/ Allow: /wp-admin/admin-ajax.php User-agent: Mediapartners-Google* Allow: / User-agent: Googlebot-Image Allow: /wp-content/uploads/ User-agent: Adsbot-Google Allow: / User-agent: Googlebot-Mobile Allow: / Sitemap: https://site.com/sitemap_index.xml

        this will work ??
        Regards
        Sajad

        1 Reply Last reply Reply Quote 0
        • topic:timeago_earlier,2 months
        • SAjad687
          SAjad687 last edited by Oct 9, 2019, 11:28 AM Oct 9, 2019, 11:28 AM

          User-agent: *
          Disallow: /cgi-bin/
          Disallow: /wp-admin/
          Disallow: /archives/
          Disallow: /*?*
          Allow: /comments/feed/
          Disallow: /refer/
          Disallow: /index.php
          Disallow: /wp-content/plugins/
          Allow: /wp-admin/admin-ajax.php
          
          User-agent: Mediapartners-Google*
          Allow: /
          
          User-agent: Googlebot-Image
          Allow: /wp-content/uploads/
          
          User-agent: Adsbot-Google
          Allow: /
          
          User-agent: Googlebot-Mobile
          Allow: /
          
          Sitemap: https://site.com/sitemap_index.xml
          
          use this it will help you
          
          Regards
          [Saad](https://clicktestworld.com/)
          
          Hoslaa 1 Reply Last reply Dec 4, 2019, 1:57 PM Reply Quote 0
          • topic:timeago_earlier,7 months
          • NickSamuel
            NickSamuel last edited by Mar 20, 2019, 6:04 PM Mar 20, 2019, 6:04 PM

            Hi Jeff,

            Robots.txt tester as per the above link is definitely worth playing with and is the easiest route to achieving what you want.

            Another reactive way of managing this is in some cases is to simply see the range of parameters Google has naturally crawled within Search Console.

            You can see this in the old search console for now. So login and go to Crawl --> URL Parameters.

            If Googlebot has encountered any ?=params it will list them. You'll then have an option how to manage them or exclude them from the index.

            It can be a decent way of cleaning up a site with lot's of indexed pages (1,000+), although please be sure to read this documentation before using it: https://support.google.com/webmasters/answer/6080548?hl=en

            1 Reply Last reply Reply Quote 0
            • topic:timeago_earlier,21 days
            • effectdigital
              effectdigital last edited by Feb 27, 2019, 3:21 PM Feb 27, 2019, 3:20 PM

              With this kind of thing, it's really better to pick the specific parameters (or parameter combinations) which you'd like to exclude, e.g:

              User-agent: *
              
              

              Disallow: /shop/product/&size=*

              Disallow: */shop/product/*?size=* 
              
              

              Disallow: /stockists?product=*

              ^ I just took the above from a robots.txt file which I have been working on, as these particular pages don't have 'pretty' URLs with unique content on. Very soon now that will change and the blocks will be lifted

              If you are really 100% sure that there's only one param which you want to let through, then you'd go with:

              User-agent: *
              
              

              Disallow: /?

              Allow: /?utm_source=google_shopping

              Allow: /*&utm_source=google_shopping*
              

              (or something pretty similar to that!)

              Before you set anything live, get down a list of URLs which represent the blocks (and allows) which you want to achieve. Test it all with the Robots.txt tester (in Search Console) before you set anything live!

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 out of 6
              • First post
                1/6
                Last post

              Got a burning SEO question?

              Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


              Start my free trial


              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.

              • See all categories

              Related Questions

              • AspenFasteners

                What happens to crawled URLs subsequently blocked by robots.txt?

                We have a very large store with 278,146 individual product pages. Since these are all various sizes and packaging quantities of less than 200 product categories my feeling is that Google would be better off making sure our category pages are indexed. I would like to block all product pages via robots.txt until we are sure all category pages are indexed, then unblock them. Our product pages rarely change, no ratings or product reviews so there is little reason for a search engine to revisit a product page. The sales team is afraid blocking a previously indexed product page will result in in it being removed from the Google index and would prefer to submit the categories by hand, 10 per day via requested crawling. Which is the better practice?

                Intermediate & Advanced SEO | Jul 27, 2021, 9:02 PM | AspenFasteners
                1
              • tnixis

                Is a Wordpress AMP plugin sufficient, or should we upgrade our WP theme to an AMP theme?

                Hello there,  our site is on a Flatsome Wordpress theme (which is responsive and does not support AMP), and we are currently using the AMP for Wordpress plugin on our blog and other content rich pages. My question is - is a plugin sufficient to make our pages AMP friendly? Or should we consider switching to a theme that is AMP enabled already? Thanks!
                Katie

                Intermediate & Advanced SEO | Jun 22, 2019, 12:33 PM | tnixis
                0
              • jamiegriz

                SEO Best Practices regarding Robots.txt disallow

                I cannot find hard and fast direction about the following issue: It looks like the Robots.txt file on my server has been set up to disallow "account" and "search" pages within my site, so I am receiving warnings from the Google Search console that URLs are being blocked by Robots.txt. (Disallow: /Account/ and Disallow: /?search=). Do you recommend unblocking these URLs? I'm getting a warning that over 18,000 Urls are blocked by robots.txt. ("Sitemap contains urls which are blocked by robots.txt"). Seems that I wouldn't want that many urls blocked. ? Thank you!!

                Intermediate & Advanced SEO | Sep 4, 2017, 6:02 AM | jamiegriz
                0
              • Malika1

                If Robots.txt have blocked an Image (Image URL) but the other page which can be indexed has this image, how is the image treated?

                Hi MOZers, This probably is a dumb question but I have a case where the robots.tags has an image url blocked but this image is used on a page (lets call it Page A) which can be indexed. If the image on Page A has an Alt tags, then how is this information digested by crawlers? A) would Google totally ignore the image and the ALT tags information? OR B) Google would consider the ALT tags information? I am asking this because all the images on the website are blocked by robots.txt at the moment but I would really like website crawlers to crawl the alt tags information. Chances are that I will ask the webmaster to allow indexing of images too but I would like to understand what's happening currently. Looking forward to all your responses 🙂 Malika

                Intermediate & Advanced SEO | Jun 16, 2016, 11:17 AM | Malika1
                1
              • YairSpolter

                Block in robots.txt instead of using canonical?

                When I use a canonical tag for pages that are variations of the same page, it basically means that I don't want Google to index this page. But at the same time, spiders will go ahead and crawl the page. Isn't this a waste of my crawl budget? Wouldn't it be better to just disallow the page in robots.txt and let Google focus on crawling the pages that I do want indexed? In other words, why should I ever use rel=canonical as opposed to simply disallowing in robots.txt?

                Intermediate & Advanced SEO | Jul 23, 2014, 11:19 AM | YairSpolter
                0
              • Modi

                Robots Disallow Backslash - Is it right command

                Bit skeptical, as due to dynamic url and some other linkage issue, google has crawled url with backslash and asterisk character ex - www.xyz.com/\/index.php?option=com_product www.xyz.com/\"/index.php?option=com_product Now %5c is the encoded version of \ - backslash & %22 is encoded version of asterisk Need to know for command :- User-agent: *   Disallow: \As am disallowing all backslash url through this - will it only remove the backslash url which are duplicates or the entire site,

                Intermediate & Advanced SEO | Jun 24, 2013, 11:38 PM | Modi
                0
              • COEDMediaGroup

                301 redirect with /? in URL

                For a Wordpress site that has the ending / in the URL with a ? after it... how can you do a 301 redirect to strip off anything after the / For example how to take this URL domain.com/article-name/?utm_source=feedburner and 301 to this URL domain.com/article-name/ Thank you for the help

                Intermediate & Advanced SEO | Apr 24, 2013, 6:25 AM | COEDMediaGroup
                0
              • IHSwebsite

                Robots.txt: Can you put a /* wildcard in the middle of a URL?

                We have noticed that Google is indexing the language/country directory versions of directories we have disallowed in our robots.txt. For example: Disallow: /images/ is blocked just fine However, once you add our /en/uk/ directory in front of it, there are dozens of pages indexed. The question is: Can I put a wildcard in the middle of the string, ex. /en/*/images/, or do I need to list out every single country for every language in the robots file. Anyone know of any workarounds?

                Intermediate & Advanced SEO | Sep 26, 2012, 1:10 PM | IHSwebsite
                0

              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
              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 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
              • Accessibility
              • Terms of Use
              • Privacy

              Looks like your connection to Moz was lost, please wait while we try to reconnect.