How to disallow query strings in robots.txt?

Member

by elliott , in category: SEO , 8 months ago

How to disallow query strings in robots.txt?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by genevieve_boehm , 8 months ago

@elliott 

To disallow query strings in robots.txt, you can use the following syntax:


User-agent: * Disallow: /*?


This will tell all search engine bots to not crawl any URLs that contain a query string. The "/*?" rule blocks any URL that has a question mark, which is the beginning of a query string in a URL.