A well-optimized robots.txt
file can make a significant contribution to improving the performance of your WordPress website and reducing server load.
One robots.txt is a simple text file that is stored on a website and tells search engines which pages they can and cannot crawl. Website operators use robots.txt to make certain areas of their site invisible to search engines, for example private or irrelevant content.
The file is usually located in the main directory of the website and contains "disallow" and "allow" instructions for search engine bots. It is a useful method to control the visibility of content and optimize the SEO performance of the website.
By excluding unnecessary content from being indexed by search engines, you direct their focus to the really important pages and content. A well thought-out robots.txt
file is helpful to use the crawl budget efficiently.
The robots.txt
file is used to control search engine bots and tell them which pages or directories on your website they should - or should not - crawl. This is especially relevant for large websites with many subpages, such as WooCommerce stores, because they generate many irrelevant pages such as the shopping cart or checkout.
The aim of an optimized robots.txt
:
Here is an example of an optimized robots.txt
that blocks unnecessary WooCommerce pages as well as certain filtering and sorting parameters. This configuration is ideal for stores that want to ensure that search engine bots focus on the product pages and not on the shopping cart or checkout.
# Block WooCommerce assets User-agent: * Disallow: /cart/ Disallow: /shopping cart/ Disallow: /checkout/ Disallow: /checkout/ Disallow: /my-account/ Disallow: /my-account/ Disallow: /*?orderby= price Disallow: /*?orderby=rating Disallow: /*?orderby=date Disallow: /*?orderby=price-desc Disallow: /*?orderby=popularity Disallow: /*?filter Disallow: /*add-to-cart =* Disallow: /*?add_to_wishlist=* Disallow: /?add-to-compare=* Disallow: /*rating_filter=* Disallow: /*?wg-choose-original=* # Block Search assets User-agent: * Disallow : /search/ Disallow: *?s=* Disallow: *?p=* Disallow: *&p=* Disallow: *&preview=* Disallow: /search Disallow: *?wmc-currency=* Disallow: *?et-wishlist-page&add_to_wishlist=* Disallow: *&botiga_buy_now=1
/cart/
, /check out/
, /my-account/
are not relevant to search engines and should be blocked because they are intended for customers.orderby=price
or orderby=rating
changed, often create duplicate content and can strain the crawl budget.robots.txt
can be managed through the WordPress admin area or through an SEO plugin like Yoast or Rank Math. Alternatively, it can be uploaded directly to the root directory of your website.robots.txt
interpret. This helps to identify errors early on.Option 1: Use a tester, e.g. the one from SERanking
Option 2: Use Google
It looks like this:
With a well-structured robots.txt
file, you can significantly improve the SEO performance of your WordPress website by blocking irrelevant pages and optimizing the crawl budget. Such a file should be regularly reviewed and adapted to new content or page structures to ensure maximum efficiency.