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. Intermediate & Advanced SEO
    4. Partial Match or RegEx in Search Console's URL Parameters Tool?

    Partial Match or RegEx in Search Console's URL Parameters Tool?

    Intermediate & Advanced SEO
    15 4 1.5k
    • 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.
    • Andy.Drinkwater
      Andy.Drinkwater last edited by

      Hi Ria,

      I have never tried regular expressions in this way, so I can't tell you if this would work or not.

      However, If all 1000 of these URL's are already indexed, just disallowing access won't then remove them from Google. You would ideally be able to place a noindex tag on those pages and let Google act on them, then you will be good to disallow. I am pretty sure there is no option to noindex under the URL Parameter Tool.

      I hope that makes sense?

      -Andy

      Ria_ 1 Reply Last reply Reply Quote 0
      • Ria_
        Ria_ @Martijn_Scheijbeler last edited by

        Hi Martijn, thanks for your response!

        I'm currently looking at something like this...

        **user-agent: *** #disallowing page.php and any parameters after it
        disallow: /page.php #but leaving anything that starts with par1=ABC
        allow: /page.php?par1=ABC

        I would have thought that you could disallow things broadly like that and give an exception, as you can with files in disallowed folders. But it's not passing Google's robots.txt Tester.

        One thing that's probably worth mentioning really is that there are only two variables that I want to allow of the par1 parameter. For example's sake, ABC123 and ABC456. So would need to be either a partial match or "this or that" kinda deal, disallowing everything else.

        Andy.Drinkwater Martijn_Scheijbeler 2 Replies Last reply Reply Quote 0
        • Andy.Drinkwater
          Andy.Drinkwater @Ria_ last edited by

          Sorry Martijn, just to jump in here for a second - Ria, you can test this via the Robots.txt testing tool in search console before going live to make sure it work.

          -Andy

          Ria_ 1 Reply Last reply Reply Quote 0
          • Martijn_Scheijbeler
            Martijn_Scheijbeler @Ria_ last edited by

            My guess would be that this line needs an * at the end.
            Allow: /page.php?par1=ABC*

            Ria_ 1 Reply Last reply Reply Quote 0
            • Ria_
              Ria_ @Andy.Drinkwater last edited by

              Hi Andy,

              Disallowing them would be my first priority really, before removing from index. Didn't want to remove them before I've blocked Google from crawling them in case they get added back again next time Google comes a-crawling, as has happened before when I've simply removed a URL here and there. Does that make sense or am I getting myself mixed up here?

              My other hack of a solution would be to check the URL in the page.php, and if URL includes par1=ABC then insert noindex meta tag. (Not sure if that would work well or not...)

              Andy.Drinkwater 1 Reply Last reply Reply Quote 0
              • Ria_
                Ria_ @Martijn_Scheijbeler last edited by

                I thought so too, but according to Google the trailing wildcard is completely unnecessary, and only needs to be used mid-URL.

                1 Reply Last reply Reply Quote 0
                • Ria_
                  Ria_ @Andy.Drinkwater last edited by

                  Yep, have done. (Briefly mentioned in my previous response.) Doesn't pass 😞

                  Andy.Drinkwater 1 Reply Last reply Reply Quote 0
                  • Andy.Drinkwater
                    Andy.Drinkwater @Ria_ last edited by

                    Disallowing them would be my first priority really, before removing from index.

                    The trouble with this is that if you disallow first, Google won't be able to crawl the page to act on the noindex. If you add a noindex flag, Google won't index them the next time it comes-a-crawling and then you will be good to disallow 🙂

                    I'm not actually sure of the best way for you to get the noindex in to the page header of those pages though.

                    -Andy

                    Ria_ 1 Reply Last reply Reply Quote 0
                    • Andy.Drinkwater
                      Andy.Drinkwater @Ria_ last edited by

                      Ah sorry I missed that bit!

                      -Andy

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

                        Don't forget that . & ? have a specific meaning within regex - if you want to use them for pattern matching you will have to escape them. Also be aware that not all bots are capable of interpreting regex in robots.txt - you might want to be more explicit on the user agent - only using regex for Google bot.

                        User-agent: Googlebot

                        #disallowing page.php and any parameters after it

                        disallow: /page.php

                        #but leaving anything that starts with par1=ABC

                        allow: page.php?par1=ABC

                        Dirk

                        Ria_ 1 Reply Last reply Reply Quote 1
                        • Ria_
                          Ria_ @Andy.Drinkwater last edited by

                          Haha, I think the train passed the station on that one. I would have realised eventually... XD

                          Thanks for your help!

                          Andy.Drinkwater 1 Reply Last reply Reply Quote 1
                          • Ria_
                            Ria_ @DirkC last edited by

                            Thank you! 😄

                            1 Reply Last reply Reply Quote 0
                            • Andy.Drinkwater
                              Andy.Drinkwater @Ria_ last edited by

                              No problem 🙂

                              Hope you get it sorted!

                              -Andy

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post
                              • After hack and remediation, thousands of URL's still appearing as 'Valid' in google search console. How to remedy?
                                effectdigital
                                effectdigital
                                0
                                2
                                155

                              • Migrating From Parameter-Driven URL's to 'SEO Friendly URL's (Slugs)
                                PatrickDelehanty
                                PatrickDelehanty
                                0
                                2
                                292

                              • What's the best possible URL structure for a local search engine?
                                AlanBleiweiss
                                AlanBleiweiss
                                0
                                8
                                980

                              • Some site's links look different on google search. For example Games.com › Flash games › Decoration games How can we do our url's like this?
                                davebuts
                                davebuts
                                0
                                4
                                268

                              • Does Google Read URL's if they include a # tag? Re: SEO Value of Clean Url's
                                Atlanta-SMO
                                Atlanta-SMO
                                0
                                6
                                1.6k

                              • Tool that can retrieve mysite URL's
                                Vahe.Arabian
                                Vahe.Arabian
                                0
                                6
                                117

                              • Best solution to get mass URl's out the SE's index
                                James77
                                James77
                                0
                                3
                                583

                              • Questions regarding Google's "improved url handling parameters"
                                john4math
                                john4math
                                0
                                2
                                668

                              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