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
    • MozCon
    • Webinars, Whitepapers, & Guides
  • Blog
  • Why Moz
    • Digital Marketers
    • Agency Solutions
    • Enterprise Solutions
    • Small Business Solutions
    • 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
    • Digital Marketers

      Simplify SEO tasks to save time and grow your traffic.

    • 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.

    • 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. Partial Match or RegEx in Search Console's URL Parameters Tool?

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.

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

Intermediate & Advanced SEO
4
15
3.2k
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.
  • Ria_
    Ria_ last edited by Oct 9, 2015, 5:55 AM

    So I currently have approximately 1000 of these URLs indexed, when I only want roughly 100 of them.

    Let's say the URL is www.example.com/page.php?par1=ABC123=&par2=DEF456=&par3=GHI789=

    All the indexed URLs follow that same kinda format, but I only want to index the URLs that have a par1 of ABC (but that could be ABC123 or ABC456 or whatever). Using URL Parameters tool in Search Console, I can ask Googlebot to only crawl URLs with a specific value. But is there any way to get a partial match, using regex maybe?

    Am I wasting my time with Search Console, and should I just disallow any page.php without par1=ABC in robots.txt?

    1 Reply Last reply Reply Quote 0
    • Andy.Drinkwater
      Andy.Drinkwater @Ria_ last edited by Oct 9, 2015, 7:54 AM Oct 9, 2015, 7:54 AM

      No problem 🙂

      Hope you get it sorted!

      -Andy

      1 Reply Last reply Reply Quote 0
      • Ria_
        Ria_ @DirkC last edited by Oct 9, 2015, 7:53 AM Oct 9, 2015, 7:53 AM

        Thank you! 😄

        1 Reply Last reply Reply Quote 0
        • Ria_
          Ria_ @Andy.Drinkwater last edited by Oct 9, 2015, 7:51 AM Oct 9, 2015, 7:51 AM

          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 Oct 9, 2015, 7:54 AM Reply Quote 1
          • DirkC
            DirkC last edited by Oct 9, 2015, 7:52 AM Oct 9, 2015, 7:47 AM

            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 Oct 9, 2015, 7:53 AM Reply Quote 1
            • Andy.Drinkwater
              Andy.Drinkwater @Ria_ last edited by Oct 9, 2015, 7:35 AM Oct 9, 2015, 7:35 AM

              Ah sorry I missed that bit!

              -Andy

              1 Reply Last reply Reply Quote 0
              • Andy.Drinkwater
                Andy.Drinkwater @Ria_ last edited by Oct 9, 2015, 7:34 AM Oct 9, 2015, 7:33 AM

                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 Oct 9, 2015, 7:51 AM Reply Quote 0
                • Ria_
                  Ria_ @Andy.Drinkwater last edited by Oct 9, 2015, 7:26 AM Oct 9, 2015, 7:26 AM

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

                  Andy.Drinkwater 1 Reply Last reply Oct 9, 2015, 7:35 AM Reply Quote 0
                  • Ria_
                    Ria_ @Martijn_Scheijbeler last edited by Oct 9, 2015, 7:24 AM Oct 9, 2015, 7:24 AM

                    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 Oct 9, 2015, 7:23 AM Oct 9, 2015, 7:23 AM

                      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 Oct 9, 2015, 7:33 AM Reply Quote 0
                      • Martijn_Scheijbeler
                        Martijn_Scheijbeler @Ria_ last edited by Oct 9, 2015, 7:22 AM Oct 9, 2015, 7:22 AM

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

                        Ria_ 1 Reply Last reply Oct 9, 2015, 7:24 AM Reply Quote 0
                        • Andy.Drinkwater
                          Andy.Drinkwater @Ria_ last edited by Oct 9, 2015, 7:18 AM Oct 9, 2015, 7:18 AM

                          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 Oct 9, 2015, 7:26 AM Reply Quote 0
                          • Ria_
                            Ria_ @Martijn_Scheijbeler last edited by Oct 9, 2015, 7:14 AM Oct 9, 2015, 7:14 AM

                            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 Oct 9, 2015, 7:22 AM Reply Quote 0
                            • Andy.Drinkwater
                              Andy.Drinkwater last edited by Oct 9, 2015, 7:11 AM Oct 9, 2015, 7:11 AM

                              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 Oct 9, 2015, 7:23 AM Reply Quote 0
                              • Martijn_Scheijbeler
                                Martijn_Scheijbeler last edited by Oct 9, 2015, 7:01 AM Oct 9, 2015, 7:01 AM

                                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 Oct 9, 2015, 7:14 AM Reply Quote 0
                                • 1 / 1
                                1 out of 15
                                • First post
                                  1/15
                                  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

                                • Davit1985

                                  My url disappeared from Google but Search Console shows indexed. This url has been indexed for more than a year. Please help!

                                  Super weird problem that I can't solve for last 5 hours. One of my urls: https://www.dcacar.com/lax-car-service.html Has been indexed for more than a year and also has an AMP version, few hours ago I realized that it had disappeared from serps. We were ranking on page 1 for several key terms. When I perform a search "site:dcacar.com " the url is no where to be found  on all 5 pages. But when I check my Google Console it shows as indexed I requested to index again but nothing changed. All other 50 or so urls are not effected at all, this is the only url that has gone missing can someone solve this mystery for me please. Thanks a lot in advance.

                                  Intermediate & Advanced SEO | Apr 8, 2019, 8:19 AM | Davit1985
                                  0
                                • NickG-123

                                  Site-wide Canonical Rewrite Rule for Multiple Currency URL Parameters?

                                  Hi Guys, I am currently working with an eCommerce site which has site-wide duplicate content caused by currency URL parameter variations. Example: https://www.marcb.com/ https://www.marcb.com/?setCurrencyId=3 https://www.marcb.com/?setCurrencyId=2 https://www.marcb.com/?setCurrencyId=1 My initial thought is to create a bunch of canonical tags which will pass on link equity to the core URL version. However I was wondering if there was a rule which could be implemented within the .htaccess file that will make the canonical site-wide without being so labour intensive. I also noticed that these URLs are being indexed in Google, so would it be worth setting a site-wide noindex to these variations also? Thanks

                                  Intermediate & Advanced SEO | Jul 25, 2016, 4:50 PM | NickG-123
                                  0
                                • peteboyd

                                  URL Injection Hack - What to do with spammy URLs that keep appearing in Google's index?

                                  A website was hacked (URL injection) but the malicious code has been cleaned up and removed from all pages. However, whenever we run a site:domain.com in Google, we keep finding more spammy URLs from the hack. They all lead to a 404 error page since the hack was cleaned up in the code. We have been using the Google WMT Remove URLs tool to have these spammy URLs removed from Google's index but new URLs keep appearing every day. We looked at the cache dates on these URLs and they are vary in dates but none are recent and most are from a month ago when the initial hack occurred. My question is...should we continue to check the index every day and keep submitting these URLs to be removed manually? Or since they all lead to a 404 page will Google eventually remove these spammy URLs from the index automatically? Thanks in advance Moz community for your feedback.

                                  Intermediate & Advanced SEO | Jun 28, 2015, 1:03 AM | peteboyd
                                  0
                                • mkhGT

                                  Do UTM URL parameters hurt SEO backlink value?

                                  Does www.example.com and www.example.com/?utm_source=Google&utm_medium=Press+Release&utm_campaign=Google have the same SEO backlink value? I would assume that Google knows the difference.

                                  Intermediate & Advanced SEO | Mar 11, 2013, 6:48 PM | mkhGT
                                  0
                                • WEB-IRS

                                  Include Cross Domain Canonical URL's in Sitemap - Yes or No?

                                  I have several sites that have cross domain canonical tags setup on similar pages.  I am unsure if these pages that are canonicalized to a different domain should be included in the sitemap.  My first thought is no, because I should only include pages in the sitemap that I want indexed. On the other hand, if I include ALL pages on my site in the sitemap, once Google gets to a page that has a cross domain canonical tag, I'm assuming it will just note that and determine if the canonicalized page is the better version.  I have yet to see any errors in GWT about this.   I have seen errors where I included a 301 redirect in my sitemap file.  I suspect its ok, but to me, it seems that Google would rather not find these URL's in a sitemap, have to crawl them time and time again to determine if they are the best page, even though I'm indicating that this page has a similar page that I'd rather have indexed.

                                  Intermediate & Advanced SEO | Jul 6, 2012, 5:24 PM | WEB-IRS
                                  0
                                • RichBestSEO

                                  Is there any negative SEO effect of having comma's in URL's?

                                  Hello, I have a client who has a large ecommerce website. Some category names have been created with comma's in - which has meant that their software has automatically generated URL's with comma's in for every page that comes beneath the category in the site hierarchy. eg. 1 : http://shop.deliaonline.com/store/music,-dvd-and-games/dvds-and-blu_rays/ eg. 2 : http://shop.deliaonline.com/store/music,-dvd-and-games/dvds-and-blu_rays/action-and-adventure/ etc... I know that URL's with comma's in look a bit ugly! But is there 'any' SEO reason why URL's with comma's in are any less effective? Kind Regs, RB

                                  Intermediate & Advanced SEO | Jul 3, 2012, 5:30 AM | RichBestSEO
                                  0
                                • CommercePundit

                                  How to fix issues regarding URL parameters?

                                  Today, I was reading help article for URL parameters by Google. http://www.google.com/support/webmasters/bin/answer.py?answer=1235687 I come to know that, Google is giving value to URLs which ave parameters that change or determine the content of a page. There are too many pages in my website with similar value for Name, Price and Number of product. But, I have restricted all pages by Robots.txt with following syntax. URLs:
                                  http://www.vistastores.com/table-lamps?dir=asc&order=name
                                  http://www.vistastores.com/table-lamps?dir=asc&order=price
                                  http://www.vistastores.com/table-lamps?limit=100 Syntax in Robots.txt
                                  Disallow: /?dir=
                                  Disallow: /?p=
                                  Disallow: /*?limit= Now, I am confuse. Which is best solution to get maximum benefits in SEO?

                                  Intermediate & Advanced SEO | Nov 16, 2011, 12:12 PM | CommercePundit
                                  0
                                • pulseseo

                                  Does Google crawl the pages which are generated via the site's search box queries?

                                  For example, if I search for an 'x' item in a site's search box and if the site displays a list of results based on the query, would that page be crawled? I am asking this question because this would be a URL that is non existent on the site and hence am confused as to whether Google bots would be able to find it.

                                  Intermediate & Advanced SEO | Nov 7, 2011, 11:56 AM | pulseseo
                                  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.