अगर आपकी website Google पर rank करनी है, तो crawling और indexing को control करना ज़रूरी है।
यहीं पर काम आता है robots.txt — एक छोटा-सा text file जो search engine bots को बताता है कि site के कौन से parts crawl करने हैं और कौन से नहीं।
इस guide में आप सीखेंगे:
- Robots.txt file kya hoti hai?
- Robots.txt कैसे काम करती है?
- Allow/Disallow के best examples
- WordPress/Blogger में robots.txt कैसे बनाएं
- Common errors और उनके fixes
- SEO best practices (2025)
- FAQs + Pro tips
चलो शुरू करते हैं! 🚀
Robots.txt File Kya Hoti Hai?
Robots.txt एक plain text file है जो आपकी site की root directory (जैसे https://example.com/robots.txt
) में रहती है।
ये file search engine crawlers (Googlebot, Bingbot, आदि) को instructions देती है — कहाँ crawl करना है और कहाँ नहीं।
- अगर आप कोई directory, admin area, test pages या duplicate content hide करना चाहते हैं, तो robots.txt से Disallow कर सकते हैं।
- अगर आप bots को hint देना चाहते हैं कि sitemap कहाँ है, तो robots.txt में Sitemap URL भी डालते हैं।
Note: Robots.txt indexing को 100% रोकती नहीं है; ये primary रूप से crawling control करती है. Indexing रोकने के लिए noindex meta tags या x-robots-tag बेहतर है।
Robots.txt file kya hai full guide video:👇👇
Robots.txt Ka Matlab Kya Hota Hai?
Matlab simple है — “Bots, please follow these rules!”
- User-agent: किस bot के लिए rule है।
- Disallow/Allow: किस path पर crawl allow या disallow है।
- Sitemap: XML sitemap का location।
Robots.txt File क्यों ज़रूरी है?
- Crawl Budget Optimization: Bots को irrelevant pages पर भटकने से रोकता है।
- Server Load Control: Heavy admin या log folders की crawling prevent करता है।
- Sensitive Areas Hide:
/wp-admin/
,/cgi-bin/
जैसे paths crawl न हों। - Duplicate/Thin Pages से बचाव: Filters, search results pages, faceted URLs को block कर सकते हैं।
Pro Tip: Robots.txt indexing stop करने का foolproof तरीका नहीं है; sensitive content को password-protect करना best है.
Robots.txt File कैसे काम करती है?
जब कोई crawler आपकी site पर आता है, वह पहले https://example.com/robots.txt
चेक करता है।
- अगर file मिल गई, तो वो matching user-agent वाले rules पढ़ता है।
- फिर वो pages crawl करता है allowed paths के हिसाब से।
- Disallow paths को generally skip करता है (हालाँकि external links से वो URLs discover हो सकते हैं)।
Core directives:
User-agent: *
→ All bots के लिए rules।Disallow: /path/
→ उस path को crawl न करें।Allow: /path/file
→ Disallow के अंदर किसी specific file/dir को allow करना।Sitemap: https://example.com/sitemap.xml
→ Sitemap hint.
Robots.txt full guide video:👇👇
Robots.txt File Structure Example
Basic Syntax
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap_index.xml
Allow vs Disallow — Practical Examples
1) WordPress default-style (safe for most sites):
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap_index.xml
2) Block internal search results, filter URLs (SEO hygiene):
User-agent: *
Disallow: /?s=
Disallow: /search/
Disallow: /*?orderby=
Disallow: /*?filter=
Sitemap: https://example.com/sitemap_index.xml
3) WooCommerce faceted URLs (careful):
User-agent: *
Disallow: /*add-to-cart=
Disallow: /*?min_price=
Disallow: /*?max_price=
Disallow: /*?rating_filter=
Sitemap: https://example.com/sitemap_index.xml
4) Prevent crawling of staging/dev (but better password-protect):
User-agent: *
Disallow: /
5) Allow everything (generally default):
User-agent: *
Disallow:
Sitemap: https://example.com/sitemap.xml
Note:
Disallow:
खाली छोड़ने का मतलब “कुछ भी disallow नहीं”।
Sitemap को Robots.txt में कैसे add करें
Sitemap hint देना helpful है:
Sitemap: https://example.com/sitemap_index.xml
Sitemap: https://example.com/post-sitemap.xml
Sitemap: https://example.com/page-sitemap.xml
Rank Math / Yoast multi-sitemap index auto generate करते हैं।
Rankmath sitemap generate guide video: 👇👇
Robots.txt File कहाँ और कैसे बनाएं?
WordPress में Robots.txt कैसे बनाएं
Method 1: SEO Plugin (Recommended)
- Rank Math → General Settings → Edit robots.txt
- Yoast SEO → Tools → File Editor → robots.txt
- Content paste करें → Save.
Method 2: File Manager / FTP
- Hosting cPanel → File Manager → root
/public_html/
में robots.txt बनाएं। - Correct permissions रखें (644)।
Method 3: Security via Cloudflare (optional rules)
- Cloudflare में rules से bots को challenge/block कर सकते हैं (robots.txt अलग है, पर साथ में helpful)।
Blogger/Blogspot में Robots.txt कैसे add करें
- Blogger Dashboard → Settings → Crawlers and indexing
- Enable custom robots.txt → Paste your rules
- Save.
- Test on:
https://yourblog.blogspot.com/robots.txt
Blogger/Blogspot me Robots.txt file kaise add kare full guide video: 👇👇
Robots.txt File के फायदे और नुकसान
फायदे
- Crawl budget optimize.
- Duplicate/thin pages की crawling कम।
- Server load कम।
- Sitemap hint से discovery better।
नुकसान / Limitations
- Security tool नहीं है — केवल crawling hint है।
- Disallowed URL फिर भी index हो सकता है अगर external links ज़्यादा हैं।
- Wrong rules से important pages deindexed हो सकते हैं।
- Over-blocking से traffic drop।
Pro Tip: Sensitive content (admin, private docs) को password-protect करें; robots.txt पर भरोसा ना करें।
Common Robots.txt Errors (2025) — और Fix
1) Accidentally blocking the whole site
User-agent: *
Disallow: /
Fix: तुरंत हटाएं या specific paths block करें। GSC में “URL Inspection” से recrawl कराएं।
2) Blocking CSS/JS files
अगर CSS/JS block कर दिए, Google page render ठीक से नहीं करेगा → ranking impact।
Fix: /wp-includes/
, theme /assets/
आदि को block ना करें।
3) Using noindex in robots.txt (deprecated)
Google अब noindex
directive को robots.txt से ignore करता है।
Fix: Page-level <meta name="robots" content="noindex">
या X-Robots-Tag
header use करें।
4) Wrong wildcard usage
*
और $
का गलत use unexpected blocking कर सकता है।
Fix: Patterns को test करें (GSC → robots.txt Tester हट चुका है; अपने pattern local पर test करें या staging पे validate करें)।
5) Sitemap URL गलत या missing
Fix: सही absolute URL डालें; https
version use करें; redirect न हो।
6) Case sensitivity भूल जाना
Unix servers में /Folder/
vs /folder/
अलग माने जा सकते हैं।
Fix: Real path confirm करें।
Google Search Console में Robots.txt कैसे Check/Monitor करें
- GSC → Settings → Crawl stats: Crawl behavior देखें।
- URL Inspection → Live test से देखें URL eligible है या नहीं।
- Coverage / Page indexing reports देखें: “Crawled – currently not indexed”, “Blocked by robots.txt” flags.
- Server logs (advanced) से bot behavior verify करें।
Read More: Complete Guide 2025: Google Search Console क्या है Full Review
Robots.txt SEO Best Practices (2025)
- Minimum blocking रखें
- Unnecessary blocking मत करो।
- CSS/JS allow रहने दें ताकि Google page render कर सके।
- Low-value pages block करें
- Internal search (
/?s=
), faceted filters (?color=
,?size=
), cart/add-to-cart parameters। - Admin/CGI/temp folders।
- Use trailing slashes for directories
Disallow: /tmp/
(directory) vsDisallow: /tmp
(file)।
- Sitemap hint हमेशा दें
- Multi-sitemap index का URL दें (Rank Math/Yoast compatible)।
- Staging/dev sites को password-protect करें
- केवल
Disallow: /
पर भरोसा न करें।
- Noindex के लिए meta robots/X-Robots-Tag use करें
- Robots.txt indexing रोकने का tool नहीं है।
- Consistent canonical + clean URLs रखें
- Query parameters और duplicate paths कम रखें।
- Regular audit करें
- Quarterly robots.txt review करें, major site changes के बाद re-check करें।
Robots.txt Examples — Niche Wise
(A) Standard WordPress Blog
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /?s=
Disallow: /search/
Sitemap: https://example.com/sitemap_index.xml
(B) WooCommerce / E-commerce
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /*add-to-cart=
Disallow: /*?orderby=
Disallow: /*?min_price=
Disallow: /*?max_price=
Disallow: /*?rating_filter=
Sitemap: https://example.com/sitemap_index.xml
(C) News/Magazine
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Disallow: /tag/*?*
Disallow: /category/*?*
Sitemap: https://example.com/sitemap_index.xml
(D) SaaS/Docs Site
User-agent: *
Disallow: /admin/
Disallow: /internal/
Allow: /assets/
Sitemap: https://example.com/sitemap.xml
(E) Complete Block (Maintenance/Staging)
User-agent: *
Disallow: /
याद रहे: staging को password-protect ज़रूर करें.
Robots.txt vs Meta Robots vs X-Robots-Tag
- Robots.txt → Crawling control (path-level).
- Meta Robots (HTML tag) → Page-level indexing control (
noindex
,nofollow
,noarchive
आदि)। - X-Robots-Tag (HTTP header) → Non-HTML files (PDFs, images) पर भी rules दे सकते हैं।
Scenario Examples:
- Filters/Search pages: robots.txt से crawl block + internal linking limit.
- Thin content: meta robots
noindex, follow
. - PDFs को noindex:
X-Robots-Tag: noindex
.
Advanced Tips (Pro Level)
- Log file analysis: जानें कि Googlebot कहाँ time spend कर रहा है; robots.txt rules tune करें।
- Crawl-delay: Google ignore करता है; Bing/Yandex consider कर सकते हैं।
- Separate rules per bot:
User-agent: Googlebot-Image Disallow: /private-images/
- CDN/Reverse proxy: Ensure robots.txt सही origin से serve हो।
- Multilingual sites: All language versions की root पर robots.txt रखें (e.g.,
example.de/robots.txt
अगर अलग host)।
Related Questions / FAQs (Robots.txt in Hindi)
Q1. Robots.txt file kya hoti hai in Hindi?
Q2. Robots.txt file कहाँ मिलती है?
https://yourdomain.com/robots.txt
।Q3. क्या robots.txt से page index रुक जाता है?
Q4. Blogger/Blogspot पर robots.txt कैसे add करें?
Q5. WordPress में robots.txt edit कहाँ से करें?
Q6. Robots.txt में sitemap डालना जरूरी है?
Q7. क्या CSS/JS को block करना चाहिए?
Q8. Accidentally पूरी site block हो गई, क्या करें?
Disallow: /
हटाइए, correct rules रखें, GSC से recrawl करवाइए।Q9. E-commerce में robots.txt कैसे रखें?
Q10. क्या robots.txt से security मिलती है?
Q11. Crawl budget क्या होता है?
Q12. क्या noindex
robots.txt में काम करता है?
Q13. Subdomain के लिए अलग robots.txt चाहिए?
https://blog.example.com/robots.txt
।Q14. News sites में क्या block करें?
Q15. क्या Disallow किया हुआ URL फिर भी index हो सकता है?
Conclusion – Robots.txt File Kya Hoti Hai (Final Words + CTA)
अब आपके पास robots.txt की पूरी समझ है — क्या है, कैसे काम करता है, किसे block करना है, किसे नहीं, और common mistakes कैसे avoid करनी हैं।
Action Plan (आज ही करें):
- अपनी site का
https://yourdomain.com/robots.txt
open करके check करें। - ऊपर दिए गए safe templates अपनी site type के हिसाब से apply करें।
- Sitemap URL जरूर add करें।
- CSS/JS कभी block न करें।
- Quarterly robots.txt audit करें और site changes पर update करें।
“मैं Aashish Kushwaha, एक passionate content creator और digital entrepreneur हूँ। मुझे Blogging, SEO और Affiliate Marketing का real-time अनुभव है और मैं अपने ब्लॉग पर step-by-step tutorials, case studies और earning tips share करता हूँ। मेरा mission है कि हर beginner blogger online दुनिया में अपना career बना सके।”
Discover more from Akblogger
Subscribe to get the latest posts sent to your email.