How to disallow query strings in robots.txt?

Member

by elliott , in category: SEO , a year ago

How to disallow query strings in robots.txt?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by genevieve_boehm , a year 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.