Key takeaways
- Serve the sitemap at a stable public URL.
- Include canonical URLs only.
- Exclude login, account, preview and duplicate routes.
- Reference the sitemap from robots.txt.
- Regenerate or update it when dynamic public content changes.
Why a sitemap matters on a JavaScript application
Internal links remain essential, but a sitemap gives crawlers a clean inventory of intended public URLs. This is especially useful when new routes are added frequently or some pages are not linked prominently from navigation.
Common sitemap mistakes
Typical failures include returning an HTML app shell at /sitemap.xml, listing preview domains, mixing trailing-slash variants, including noncanonical URLs or forgetting new routes. SearchFix compares crawl-discovered pages with sitemap entries to find coverage gaps.
What to include
Include URLs that are public, canonical, useful and intended for indexing. A sitemap is not a place to dump every technical route. If a page should not appear in search, adding it to the sitemap sends a conflicting signal.
Frequently asked questions
Does every Lovable site need a sitemap?
Small sites can be discovered through links alone, but a sitemap is still a useful, low-cost way to communicate the intended set of public canonical URLs.
Should sitemap.xml include query parameters?
Usually no. Include the canonical URL for the page unless a parameterized URL represents a distinct page that is intentionally indexable.
Where should I reference the sitemap?
Reference the absolute sitemap URL in robots.txt and submit the sitemap to the relevant search-engine webmaster tools when available.