
Setting up robots.txt for search engines
The robots.txt file is one of the basic tools of technical SEO. It helps control which pages of the site search bots, including Google, can crawl.
Properly configuring robots.txt can speed up indexing, avoid duplicates, and protect service sections of the site.
What is robots.txt
robots.txt is a text file placed in the root of the site:
It contains instructions for search engines like Google Search.
Basic robots.txt directives
1. User-agent
Specifies which bot the rule applies to:
* means all search bots.
2. Disallow
Prohibits access to specific pages or sections:
Disallow: /cart/
3. Allow
Allows access to specific pages:
4. Sitemap
Specifies the path to the sitemap:
Example of a correct robots.txt
📌 This means:
-
admin panel and checkout are blocked
-
other pages are open for indexing
Common mistakes
1. Complete indexing ban
❌ Blocks the entire site from Google
Blocking CSS and JS
❌ Can disrupt site display
📌 Solution: do not block important resources
3. Missing sitemap
Without a sitemap, it's harder for bots to find pages.
4. Incorrect paths
Errors in URL spelling make rules useless.
How to check robots.txt
Via browser
Open:
Via Google Search Console
-
Robots.txt file check
-
Crawl error analysis
Configuration recommendations
-
Block service pages (admin panel, cart, filters)
-
Leave content that should rank open
-
Add a link to sitemap.xml
-
Do not block CSS and JS
-
Regularly check the file after changes
robots.txt and SEO
The robots.txt file does not guarantee the removal of pages from the index, but:
-
manages crawling budget
-
helps to index important pages faster
-
reduces server load
Important note
If you need to completely remove a page from search results, use:
-
the
noindexmeta tag -
or tools in Google Search Console
robots.txt is a simple but powerful SEO tool. Competent configuration helps search engines correctly understand the site structure and promote it faster in Google.