Home / Guides
How to Make a Sitemap and robots.txt File
A sitemap lists the pages you want found. A robots file tells crawlers where they may go. Both are small text files, and both are worth ten minutes.
The sitemap
It is an XML file, usually at /sitemap.xml, with one entry per page:
<url><loc>https://example.com/about</loc><lastmod>2026-11-26</lastmod></url>
Rules that keep it clean
- List only pages that load directly with a normal 200 response.
- Use the exact address of each page, the same one as its canonical link.
- Do not list redirected, broken or private pages.
- Use
httpsand your chosen host name only.
The robots file
A plain text file at /robots.txt. The simplest version welcomes everyone and points at the sitemap:
User-agent: *Allow: /Sitemap: https://example.com/sitemap.xml
Submit it
Add the sitemap in the search engines' free webmaster tools. Check back in a few days for errors.
Keep it fresh
Update the last-modified dates when you change a page, and add new pages as you publish them.