Technical SEO Reference 5 menit

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

  1. Disallow: / di root. Block seluruh situs. Paling sering dari staging yang lupa dimatikan.
  2. Disallow: /wp-admin/ tanpa trailing slash. Block juga /wp-admin-tutorial/.
  3. Block /images/ padahal image ada di sitemap. Kontradiksi sinyal.
  4. Block resource file (CSS, JS) yang dibutuhkan rendering. Google butuh untuk evaluate page.
  5. Sitemap URL di robots.txt salah. 404 atau HTTP bukan HTTPS.
  6. User-agent: * Disallow: / di bagian awal, lalu exception di bawah yang tidak effective.**
  7. Whitespace atau BOM di awal file. Parser bisa tidak detect directive.
  8. Wildcard yang tidak valid. Disallow: * tanpa / di depan.
  9. Case mismatch: Allow: /page/ vs URL Allow: /Page/. Case-sensitive.
  10. 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.
Rule of thumb

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.