Mobile app version of vmapp.org
Login or Join
Martha676

: Blocking every URL with "?" in it Will below Disallow function will block every URL which has "?" in it? Disallow: /*?*PrintPage=yes* I was actually checking few pages with "?" in them and

@Martha676

Posted in: #QueryString #RobotsTxt

Will below Disallow function will block every URL which has "?" in it?

Disallow: /*?*PrintPage=yes*


I was actually checking few pages with "?" in them and they were not indexed in Google and then I saw some other URLs with "?" and they are indexed in Google.

Why is this happening, also these "?" pages don't have noindex tag or canonical tag.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Martha676

2 Comments

Sorted by latest first Latest Oldest Best

 

@Shanna517

If you want to block pages with parameters the best way to do it is with Google search console under Crawl > URL Parameters. This will remove the pages pretty quickly and will likely improve your overall rankings.

10% popularity Vote Up Vote Down


 

@Margaret670

No, it does not block all webpages that have ? in URL.

Disallow: /*?*PrintPage=yes*


This will block below kind of pages for example.
example.com/sometext?xPrintPage=yes.html www.example.com/123?PrintPage=yes.php example.com/Some-123?xyz-PrintPage=yes/another-page/

Did you notice anything? That rule will block only those pages that contain ? and PrintPage=yes, In that rule, you can add any characters before and after ? . Same thing will apply to *PrintPage=yes* as well.

To block every webpage that have ? in URL, you have to use * in both front and end side like this

Disallow: /*?*


I strongly recommended you to checkout this Google reference about robots.txt.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme