Creating and Uploading a sitemap.xml
Quick Answer
A sitemap.xml is an XML file at the root of your website listing every page you want search engines to index. Each entry includes the URL and an optional last-modified date. To create one on static.app, use the Files section's Create File feature, name it sitemap , select .xml from the extension dropdown, and paste in your URLs. Then submit the file URL to Google Search Console and Bing Webmaster Tools.
A sitemap is a list of every page on your website, in a format search engines understand. Google doesn't strictly need one (it can find pages through links), but giving it a sitemap speeds up indexing and tells it which pages are most important. For new websites with few inbound links, a sitemap is the fastest way to get all your pages discovered.
The file goes at the root of your website, at yoursite.com/sitemap.xml .
The format
A sitemap is XML, which is just structured text. Here's a complete sitemap for a small website:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://yoursite.com/</loc> <lastmod>2026-05-10</lastmod> </url> <url> <loc>https://yoursite.com/about.html</loc> <lastmod>2026-04-22</lastmod> </url> <url> <loc>https://yoursite.com/shop.html</loc> <lastmod>2026-05-12</lastmod> </url> <url> <loc>https://yoursite.com/contact.html</loc> <lastmod>2026-03-15</lastmod> </url> </urlset>
A few notes on what's in there. The <loc> is the full URL of the page, including https:// . The <lastmod> is the date the page was last meaningfully changed, in YYYY-MM-DD format. You can skip <lastmod> if you don't want to maintain it, but Google uses it as a hint about which pages to recrawl.
You'll see other tags in older tutorials (<changefreq> , <priority> ). Google ignores both. Don't bother including them.
Creating yours
For a website with under 20 pages, write it by hand. Copy the template above, change the URLs to match your actual pages, save as sitemap.xml .
For a larger website, use a free generator like xml-sitemaps.com. Enter your URL, it crawls your website, and gives you the file to download. The free version covers up to 500 URLs.
If you're deploying through the static.app API or MCP server, consider generating the sitemap as part of your deploy flow so it stays current automatically. The pattern is: build script crawls your output folder, writes a sitemap.xml, pushes it alongside the website files.
Uploading it
You have two ways to get the file on your website, both through the Files section in your dashboard:
- Upload a
sitemap.xmlyou've written locally. Drag and drop it into the Files view. - Create a file directly in the platform. Choose Create a File, name it
sitemap, pick.xmlfrom the extension dropdown, then paste the XML into the built-in code editor.
Either way, the file needs to live at the root of your project (same level as index.html ). Verify it's working by visiting yoursite.com/sitemap.xml in your browser. You should see the XML.
If you see a 404, the file is in the wrong folder. If you see plain text without the XML structure rendering, that's actually fine. Browsers display sitemaps differently depending on settings. What matters is that the content is there.
Submitting it
Open Google Search Console, click Sitemaps in the left menu, paste your sitemap URL, click Submit. Search Console will report back within a day or two with the number of URLs discovered and any errors.
Do the same in Bing Webmaster Tools. Same process, same outcome.
When your sitemap is wrong
The most common errors:
- URLs that return 404. Remove pages from the sitemap when you delete them. Search Console will flag these as errors.
- HTTP vs HTTPS mismatch. If your website loads on
https://but your sitemap listshttp://URLs, Google sees those as redirects and stops trusting the sitemap. - Pages listed that have a noindex tag. Pick one. If you don't want it indexed, leave it out of the sitemap.
- Pages blocked by robots.txt that are also in the sitemap. Conflicting signals confuse Google.
- Trailing slash inconsistency. If your website uses
/about/, the sitemap should too. If it uses/about.html, list the.html.
Search Console will tell you about all of these in the Sitemaps report. Check it once a month or after any significant website change.
Linking your sitemap from robots.txt
Add this line to your robots.txt file:
Sitemap: https://yoursite.com/sitemap.xml
This helps search engines that don't read Search Console (or other AI crawlers) find your sitemap automatically. A separate article covers robots.txt in detail.
Update it when you add pages
A sitemap is only useful if it reflects reality. Every time you add or remove a page, edit the sitemap. For websites that change rarely, this is a five-minute task once or twice a year. For active blogs, automate it.
Frequently Asked Questions
Is a sitemap.xml required for SEO?
Not strictly. Google can find pages through internal links alone. But sitemaps speed up indexing significantly for new websites and help search engines understand which pages are most important. For any website with more than 5 pages, the cost of creating one (10 minutes) is far less than the SEO benefit.
How often should I update my sitemap?
Every time you add or remove a page. If you publish frequently (a weekly blog), automate the sitemap generation as part of your deploy. For websites that change rarely, a manual update once or twice a year is fine.
Can I have multiple sitemaps?
Yes. For websites with more than 50,000 URLs, you'd split into multiple sitemaps and reference them in a sitemap index file. For static.app users, you'd realistically never hit that limit, so a single sitemap.xml is enough.
What if my sitemap shows errors in Search Console?
The most common errors: URLs returning 404, HTTP vs HTTPS mismatch, pages with noindex tags in the sitemap, or pages blocked by robots.txt. Search Console's Sitemaps report tells you which URLs are problematic. Remove or fix them, then resubmit.
Should I include images in my sitemap?
If you have an image-heavy website (photography, e-commerce), yes. Use the <image:image> extension to list images per URL. For most static websites, a plain sitemap with just URLs is enough.