{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-robots-txt-424e9a389804","title":"Publish a robots.txt File","summary":"Serve a valid `robots.txt` file at `\/robots.txt` on the production domain, returning HTTP 200, and include a `Sitemap:` directive pointing to your XML sitemap.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-robots-txt-424e9a389804","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-robots-txt-424e9a389804","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-robots-txt-424e9a389804.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-robots-txt-424e9a389804\/download","category":{"slug":"content-editorial","name":"Content & Editorial"},"editor_note":"Ensure the `robots.txt` file is served from the root of the production domain and returns HTTP 200. Include a `Sitemap:` directive pointing to the XML sitemap. Avoid using `Disallow: \/` on a live site, as it can block all crawlers and negatively impact SEO.","instructions":"---\nname: robots-txt\ndescription: \"Use when applies to any public website. Use when auditing technical SEO foundations or diagnosing crawl coverage gaps.\"\nmetadata:\n  category: seo\n  priority: high\n  difficulty: beginner\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/seo\/robots-txt\n---\n\n# Publish a robots.txt file\n\nrobots.txt is the first file crawlers fetch; misconfigured directives can silently block search engines from crawling your entire site, killing organic visibility.\n\n## Quick Reference\n\n- Serve a valid `robots.txt` at `\/robots.txt` on the production domain, returning HTTP 200\n- Include a `Sitemap:` directive pointing to your XML sitemap\n- Never disallow crawling of CSS\/JS assets that render your pages\n- Avoid blocking all crawlers with `Disallow: \/` on a live site\n\n## Check\n\nFetch `\/robots.txt` on the live domain and verify it returns HTTP 200, uses correct `User-agent` \/ `Disallow` \/ `Allow` syntax, and includes a `Sitemap:` directive pointing to the XML sitemap. Check for accidental `Disallow: \/` directives.\n\n## Fix\n\nCreate or update `robots.txt` at the web root with valid directives. Add a live `Sitemap:` line for the production sitemap URL. Remove any `Disallow: \/` rules that block the whole site or resources needed for rendering.\n\n## Explain\n\nExplain how robots.txt controls crawler access, why an accidental `Disallow: \/` can delist a site, and why CSS\/JS must remain accessible for rendering-based indexing.\n\n## Code Review\n\nReview metadata generation, rendered HTML, structured data, and response headers related to Publish a robots.txt file. Flag exact routes or templates where search-facing output violates the rule, and describe how to verify the final page output.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/seo\/robots-txt\n","use_cases":["Serve a valid `robots.txt` file at `\/robots.txt` on the production domain, returning HTTP 200.","Include a `Sitemap:` directive pointing to your XML sitemap.","Ensure CSS\/JS assets are not disallowed in `robots.txt` to allow rendering-based indexing."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/robots-txt\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T05:29:00.000000Z","updated_at":"2026-11-24T07:12:32.000000Z","seo_title":"How to publish a robots.txt file for SEO","seo_description":"Learn how to create and publish a robots.txt file to improve SEO and ensure search engine crawlers can access your site.","seo_keywords":["robots.txt SEO","how to create robots.txt","sitemap directive robots.txt"]}}