Robots.txt: Panduan Lengkap untuk SEO (2026)
TL;DR (Ringkasan Singkat)
Robots.txt adalah file kecil yang punya impact besar ke SEO. Satu kesalahan kecil bisa block seluruh website dari Google.
format_list_bulleted
Daftar Isi
expand_more
Daftar Isi
Robots.txt adalah file kecil yang punya impact besar ke SEO. Satu kesalahan kecil bisa block seluruh website dari Google. Tapi kalau dipakai dengan benar, robots.txt bisa:
- ✅ Optimize crawl budget
- ✅ Prevent duplicate content issues
- ✅ Protect sensitive pages
- ✅ Improve indexing efficiency
Apa Itu Robots.txt? Robots.txt adalah text file yang memberitahu search engine bots:
File ini harus ada di root directory website: https://yourdomain.com/robots.txt Contoh Robots.txt Sederhana: User-agent:
* Disallow: /admin/ Disallow: /private/ Allow: / Sitemap: https://jasaseo.id/sitemap.xml Penjelasan:
- Disallow:
- Allow:
- Sitemap:
* Disallow: Common User-agents:
- Googlebot - Google Search
- Googlebot-Image - Google Images
- Googlebot-News - Google News
- Bingbot - Bing
- All bots
* Disallow: /private/ Allow: /private/public-page.html Ini allow /private/public-page.html meskipun /private/ di-block. 4. Sitemap Specify lokasi XML sitemap: Sitemap: https://jasaseo.id/sitemap.xml Sitemap: https://jasaseo.id/sitemap-blog.xml Sitemap: https://jasaseo.id/sitemap-products.xml Bisa list multiple sitemaps. 5. Crawl-delay(Deprecated untuk Google) User-agent:
* Crawl-delay: 10 Google tidak support Crawl-delay. Pakai Google Search Console untuk adjust crawl rate. Baca juga: XML Sitemap Optimization
Robots.txt Best Practices untuk SEO
1. Block Admin & System Pages User-agent:
* Disallow: /admin/ Disallow: /wp-admin/ Disallow: /wp-login.php Disallow: /cgi-bin/ Why: Pages ini nggak ada value untuk SEO dan waste crawl budget. 2. Block Duplicate Content Disallow: /print/ Disallow: /*?sort= Disallow: /*?filter= Disallow: /search? Why: Prevent Google crawl duplicate versions dari same content. 3. Block Low-Value Pages Disallow: /cart/ Disallow: /checkout/ Disallow: /thank-you/ Disallow: /account/ Why: User-specific pages nggak perlu di-index. 4. Allow Important Resources User-agent:
* Disallow: /wp-admin/ Allow: /wp-admin/admin-ajax.php Why: Some resources (CSS, JS, images) needed untuk render pages correctly. 5. Specify Sitemap Location Sitemap: https://jasaseo.id/sitemap.xml Why: Help bots discover all important pages faster. lightbulb Pro Tip Test robots.txt pakai Google Robots.txt Tester sebelum deploy.
Common Robots.txt Mistakes (& Cara Fixnya)
⚠️Mistake #1: Blocking Entire Website User-agent:
* Disallow: / Impact: Website completely deindexed dari Google. Fix: User-agent:
* Disallow: ⚠️Mistake #2: Blocking CSS/JS Disallow: /assets/ Disallow:
- .css
- .js
Advanced Robots.txt Strategies
1. Optimize Crawl Budget (Large Sites) Untuk website dengan 10,000+ pages , prioritize important pages: User-agent: Block low-value pages Disallow: /tag/ Disallow: /author/ Disallow: /page/ Disallow: /*? Allow high-value pages Allow: /blog/ Allow: /products/ Allow: /services/ Sitemap: https://jasaseo.id/sitemap.xml 2. E-commerce Faceted Navigation User-agent: Block filter combinations Disallow: /*?color= Disallow: /*?size= Disallow: /*?price= Disallow: /*& Allow main category pages Allow: /products/ Why: Prevent crawling millions of filter combinations. Baca juga: Faceted Navigation SEO 3. Block Search Results Pages Disallow: /search? Disallow: /search/ Disallow: /*?s= Why: Internal search results are duplicate/low-value content. 4. Block Staging/Development Sites User-agent:
* Disallow: / Why: Prevent staging site dari competing dengan production site. 5. Different Rules untuk Different Bots Google: Allow everything except admin User-agent: Googlebot Disallow: /admin/ Bing: More restrictive User-agent: Bingbot Disallow: /admin/ Disallow: /search/ Block bad bots User-agent: Ahrefs Bot Disallow: / User-agent: Semrush Bot Disallow: /
Robots.txt vs Meta Robots vs X-Robots-Tag
Comparison: Method Scope Use Case Robots.txt Site-wide rules Block crawling (save crawl budget) Meta Robots Per-page rules Control indexing (noindex, nofollow) X-Robots-Tag HTTP header Control indexing untuk non-HTML (PDFs, images) When to Use Each: Robots.txt:
- ✅ Block low-value sections (admin, search, filters)
- ✅ Optimize crawl budget
- ⚠️
Meta Robots: <meta name="robots" content="noindex, follow"> ✅ Prevent specific pages dari indexing ✅ Control link equity flow X-Robots-Tag: X-Robots-Tag: noindex ✅ Control indexing untuk PDFs, images, videos error Warning Robots.txt blocks crawling, NOT indexing. Kalau page sudah di-index, blocking via robots.txt nggak akan remove dari index. Pakai noindex instead. Baca juga: Canonical Tag Guide
- Cara Test & Validate Robots.txt
- ✅ File accessible (200 status code)
- ✅ Correct syntax
- ✅ Sitemap URL correct
* Disallow: /admin/ Disallow: /private/ Allow: / Sitemap: https://yourdomain.com/sitemap.xml Template 2: E-commerce Site User-agent:
*
- Block admin & checkout
* Disallow: / Monitoring & Maintenance Monthly Tasks: ✅ Check Google Search Console untuk crawl errors ✅ Verify sitemap URL masih valid ✅ Review blocked URLs (ada yang accidentally blocked?) Quarterly Tasks: ✅ Audit crawl budget usage ✅ Review & update blocked sections ✅ Test robots.txt dengan new pages/features After Major Updates: ✅ Verify robots.txt nggak accidentally changed ✅ Test dengan Google Robots.txt Tester ✅ Monitor indexing status di GSC Kesimpulan: Robots.txt adalah Powerful Tool (Kalau Dipakai Benar) Robots.txt bisa significantly improve SEO dengan: 1. Optimize crawl budget (block low-value pages) 2. Prevent duplicate content (block filter pages, search results) 3. Protect sensitive pages (admin, user accounts) 4. Guide bots ke important content (via sitemap) Tapi one mistake bisa deindex entire website. Always test before deploy! Action Items: ✅ Audit current robots.txt (ada mistakes?) ✅ Block low-value sections (admin, search, filters) ✅ Add sitemap URL ✅ Test dengan Google Robots.txt Tester ✅ Monitor crawl stats di Google Search Console Butuh bantuan technical SEO audit? Konsultasi gratis dengan tim kami atau coba Free SEO Audit Tool.
Butuh Bantuan SEO Profesional?
Tim ahli kami siap membantu website Anda ranking di halaman 1 Google.