Every time a search engine bot (like Googlebot) visits your website, the absolute first thing it does is look for a file named robots.txt. This plain text file acts as the traffic cop for your domain, telling the bots exactly which pages they are allowed to read and which directories they must stay out of.
If you don’t configure this file correctly, you risk Google indexing your private backend login pages, or worse, accidentally blocking the bots from seeing your site entirely.
The Standard robots.txt Blueprint
This template is perfectly optimized for modern content management systems like WordPress or custom service-based websites. It allows all good search bots to crawl your public pages, explicitly blocks them from your administrative backend, and points them directly to your sitemap.
# Block bad bots and scrapers
User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /admin/
Disallow: /login/
Disallow: /trackback/
Disallow: /xmlrpc.php
# Allow bots to access necessary frontend assets
Allow: /wp-admin/admin-ajax.php
Allow: /wp-includes/css/
Allow: /wp-includes/js/
# Point bots directly to your roadmap
Sitemap: https://yourdomain.com/sitemap_index.xml
How It Works
- User-agent: *** This targets all search engine bots across the web.
- Disallow: This keeps bots out of your sensitive backend folders, saving your server’s “crawl budget” for the pages that actually matter.
- Allow: Sometimes core CSS or JavaScript files are stored in admin folders. If bots can’t read those files, they might think your site is broken or not mobile-friendly. We explicitly allow them here.
- Sitemap: This is the most important line. It hands the bots a direct map to every post and page on your website, massively speeding up the indexing process.
How to Use It
If you are using WordPress, you can easily insert this exact text using SEO plugins like Rank Math or Yoast by navigating to their “Edit robots.txt” settings. Just remember to swap out yourdomain.com with your actual website URL!