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.
    • Martijn_Scheijbeler
      Martijn_Scheijbeler last edited by

      Hi Ria,

      What you could do, but it also depends on the rest of your structure is Disallow these urls based on the parameters (what you could do in a worst case scenario is that you would disallow all URLs and then put an exception Allow in there as well to make sure you still have the right URLs being indexed).

      Martijn.

      Ria_ 1 Reply Last reply Reply Quote 0
      • 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

                                • I need help on how best to do a complicated site migration. Replacing certain pages with all new content and tools, and keeping the same URL's. The rest just need to disappear safely. Somehow.
                                  Everett
                                  Everett
                                  1
                                  4
                                  58

                                • 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

                                • How should I handle URL's created by an internal search engine?
                                  CleverPhD
                                  CleverPhD
                                  0
                                  4
                                  416

                                • What to do when all products are one of a kind WYSIWYG and url's are continuously changing. Lots of 404's
                                  evolvingSEO
                                  evolvingSEO
                                  0
                                  6
                                  201

                                • Should we use URL parameters or plain URL's=
                                  PinpointDesigns
                                  PinpointDesigns
                                  0
                                  5
                                  207

                                • 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

                                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