Clean Param in Robots Txt examples
Learn how to use clean param robots.txt to keep your website secure, with an example and tips for implementation.
Understanding the "Clean Param" Parameter in Robots.txt
The "clean param" parameter is a powerful tool for webmasters to control how search engines index their site. It is included in the robots.txt file, which is a text file that tells search engines which parts of a website they can and cannot crawl. The "clean param" parameter can be used to specify which query parameters should be ignored by search engines when they crawl a website.
For example, if a website has URLs that look like this: http://example.com/?page=1&sort=asc
, the search engine can index the page for both the page=1
and sort=asc
parameters. However, if the webmaster adds the following line to the robots.txt file:
Clean-param: page
The search engine will now ignore the page=1
parameter, and only index the page for the sort=asc
parameter. This is useful for websites with many URLs that are similar, but differ only in the query parameters.
The "clean param" parameter can also be used to exclude certain query parameters from being indexed. For example, if a website has URLs that look like this: http://example.com/?page=1&utm_source=facebook
, the search engine can index the page for both the page=1
and utm_source=facebook
parameters. However, if the webmaster adds the following line to the robots.txt file:
Clean-param: utm_source
The search engine will now ignore the utm_source=facebook
parameter, and only index the page for the page=1
parameter. This is useful for websites that use URL parameters to track visits from other websites.
The "clean param" parameter can be used to control how search engines index a website, and should be used by webmasters to ensure that their website is properly indexed by search engines. It is important to note that the "clean param" parameter is not supported by all search engines, so it is important to check with each search engine to determine if it supports this parameter.