Robots.txt sets crawl rules for search engine crawlers. Disallowing crawling does not guarantee that a URL will be excluded from search results, and it does not protect private data. URL structures and system directories differ between CMSs, so adapt the examples below and check them against your site's actual pages, CSS, JavaScript, and images.
Basic robots.txt structure
User-agent: *
Disallow: /служебные-папки/
Allow: /путь-к-которому-разрешаем-доступ/
Sitemap: https://example.com/sitemap.xmlThe Allow directive overrides Disallow for a more specific path. Sitemap points crawlers to the sitemap.
WordPress
Standard example
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /wp-login.php
Disallow: /wp-register.php
Disallow: /?s=
Disallow: /search/
Disallow: /author/
Disallow: /feed/
Disallow: /trackback/
Allow: /wp-content/uploads/
Sitemap: https://example.com/sitemap_index.xmlExplanations
| Directive | Reason |
|---|---|
Disallow: /wp-admin/ | Restricts crawling of the admin area; authentication is configured separately |
Allow: /wp-admin/admin-ajax.php | AJAX requests for the frontend |
Allow: /wp-content/uploads/ | Images in uploads are allowed |
Disallow: /?s= | Search pages (duplicates) |
Disallow: /author/ | Author archives (optional) |
Do not block /wp-includes/ in its entirety, or block plugin and cache directories: they may contain public CSS and JavaScript. The Disallow: /*?* pattern will also block required URLs with parameters, including pagination. For pagination, keep links accessible and give each page its own canonical URL.
Robots.txt does not prevent PHP from running in uploads; configure that protection on the server. Regular expressions such as .*\.(php|phtml)$ do not work here; Google supports only the * and $ patterns. See the official specification.
Yoast SEO / Rank Math
The plugins generate a sitemap. The URLs are usually:
https://example.com/sitemap_index.xml(Yoast)https://example.com/sitemap.xml(Rank Math)
11C-Bitrix
Standard example
User-agent: *
Disallow: /bitrix/admin/
Disallow: /auth/
Disallow: /personal/
Disallow: /search/
Disallow: /?logout=
Disallow: /*?*utm_
Allow: /upload/
Sitemap: https://example.com/sitemap.xmlExplanations
| Directive | Reason |
|---|---|
Disallow: /bitrix/admin/ | Restricts crawling of the admin area |
Allow: /upload/ | Publicly uploaded images and files |
Disallow: /auth/ | Authentication |
Disallow: /personal/ | Personal account |
Disallow: /*?*utm_ | UTM parameters (duplicate content) |
Do not block /bitrix/, /local/, or /upload/ in their entirety: they may contain public scripts, styles, and product images. Protect private files with server access permissions, not robots.txt.
Joomla
Standard example
User-agent: *
Disallow: /administrator/
Disallow: /installation/
Disallow: /logs/
Disallow: /temp/
Disallow: /tmp/
Disallow: /?format=
Disallow: /search/
Allow: /images/
Allow: /media/
Sitemap: https://example.com/sitemap.xmlExplanations
| Directive | Reason |
|---|---|
Disallow: /administrator/ | Admin area |
Disallow: /temp/, /tmp/ | Temporary files |
Disallow: /installation/ | Installer (remove after installation) |
Disallow: /?format= | Alternative formats (print, feed) |
Allow: /images/, /media/ | Images and media |
Do not block public resources used by the template and extensions. Component URLs may contain required pages, so blocking all of /component/ is not a universal rule.
ModX / Evolution CMS
User-agent: *
Disallow: /assets/export/
Disallow: /assets/import/
Disallow: /core/
Disallow: /manager/
Sitemap: https://example.com/sitemap.xmlOpenCart
User-agent: *
Disallow: /admin/
Disallow: /system/
Disallow: /download/
Disallow: /index.php?route=checkout/
Disallow: /index.php?route=account/
Disallow: /*?sort=
Disallow: /*?order=
Disallow: /*?limit=
Allow: /image/
Sitemap: https://example.com/index.php?route=extension/feed/google_sitemapChecking and generating
After configuring robots.txt, check it:
- Open
https://example.com/robots.txtin a browser - Make sure there are no syntax errors
- Check that required pages have not been blocked by mistake
Use the reChecker robots.txt analyzer to check directives and identify conflicts.
Special rules for crawlers
Googlebot
User-agent: Googlebot
Disallow: /admin/
Allow: /admin/public/
User-agent: *
Disallow: /admin/Yandex
User-agent: Yandex
Disallow: /personal/
Disallow: /search/Check the documentation for the specific crawler to confirm support for additional directives. Google does not support Crawl-delay; this directive does not control HTTP caching.
Summary
Each CMS has its own system URLs, such as /wp-admin/, /bitrix/admin/, and /administrator/. Use these examples as a starting point, and check important pages and public resources with a robots.txt analyzer. To exclude an accessible page from the index, use noindex while allowing it to be crawled; protect restricted sections with authentication. This distinction is explained in Google's robots.txt guide.