robots.txt Patterns yang Sering Salah
Anti-pattern robots.txt yang saya temui di audit — beberapa bisa menghilangkan semua visibility. Plus template robots.txt benar untuk situs B2B.
robots.txt adalah file kecil yang bisa menghancurkan bisnis kalau salah. Di audit 30+ situs korporat Indonesia, saya temui ~20% punya robots.txt bermasalah. Ini pola yang paling sering salah.
Top 10 anti-pattern
- Disallow: / di root. Block seluruh situs. Paling sering dari staging yang lupa dimatikan.
- Disallow: /wp-admin/ tanpa trailing slash. Block juga
/wp-admin-tutorial/. - Block /images/ padahal image ada di sitemap. Kontradiksi sinyal.
- Block resource file (CSS, JS) yang dibutuhkan rendering. Google butuh untuk evaluate page.
- Sitemap URL di robots.txt salah. 404 atau HTTP bukan HTTPS.
- User-agent: * Disallow: / di bagian awal, lalu exception di bawah yang tidak effective.**
- Whitespace atau BOM di awal file. Parser bisa tidak detect directive.
- Wildcard yang tidak valid.
Disallow: *tanpa/di depan. - Case mismatch:
Allow: /page/vs URLAllow: /Page/. Case-sensitive. - Crawl-delay 10+ detik. Google ignore, but Bing masih respect. Slow crawl.
Template robots.txt untuk B2B corporate
# robots.txt untuk example.com # Updated: 2026-04-23 User-agent: * Allow: / # Block admin & private Disallow: /admin/ Disallow: /wp-admin/ Disallow: /_inc/ Disallow: /not-config/ Disallow: /not-data/ Disallow: /pulse/ # Block draft & preview Disallow: /draft/ Disallow: /preview/ Disallow: /*?preview= Disallow: /*?s= # Block tracking parameter (optional, Google usually handle) Disallow: /*?utm_ Disallow: /*?gclid= # Allow important resource Allow: /assets/ Allow: /images/ # Sitemap Sitemap: https://example.com/sitemap.xml
Debugging checklist
- Test di Google Search Console robots tester.Pastikan halaman penting tidak terblokir.
- Fetch as Google untuk URL sample.Render harus success.
- Cek Indexing report 'Blocked by robots.txt'.Harus zero untuk halaman penting.
- Verify sitemap URL bisa di-fetch.curl -I https://example.com/sitemap.xml
- Case-match exact URL-mu.Setiap karakter matter.
Kalau ragu, lebih baik tidak Disallow. Google respect standards; over-blocking lebih merugikan dari under-blocking. Gunakan noindex meta atau header untuk halaman spesifik yang tidak ingin di-index.