Introduction
Fetch and update your project's sitemap to help search engines discover and index pages.
More information about the module's user interface https://doc.oneentry.cloud/docs/category/sitemap
🎯 What does this module do?
The Sitemap module lets you retrieve and (re)generate the sitemap of your OneEntry project - a structured list of all pages used by search engines to index your content efficiently.
A sitemap tells search engines which pages exist, helping Google, Bing, and other crawlers discover and index your content faster. Generation is triggered explicitly via updateSitemap(body); getSitemap() returns the list of generated sitemap URLs.
🚀 Quickstart
Initialize the module from defineOneEntry:
const { Sitemap } = defineOneEntry( "your-project-url", { "token": "your-app-token" });
Retrieve the list of generated sitemap URLs:
// Returns an array of sitemap URL strings (string[]).
const sitemaps = await Sitemap.getSitemap();
sitemaps.forEach((url) => {
console.log(url);
});
✨ Key Concepts
What is a Sitemap?
A sitemap is an XML file listing the pages of your website so search engines can discover and crawl them efficiently. Each entry can carry a URL, last-modified date, change frequency, and priority.
Sitemap Read vs. Update
getSitemap() returns an array of sitemap URL strings (string[]), for example:
[
'https://your-project.oneentry-cloud.com/sitemap.xml',
'https://your-project.oneentry-cloud.com/sitemap-en.xml'
]
The per-entry fields url, lastmod, changefreq, priority are input properties of ISitemapQuery (passed to updateSitemap()), not part of the getSitemap() response.
Change Frequency Values
These values are part of the updateSitemap() input (changefreq):
| Value | Meaning |
|---|---|
| always | Page changes every time it is accessed |
| hourly | Page changes every hour |
| daily | Page changes every day |
| weekly | Page changes every week |
| monthly | Page changes every month |
| yearly | Page changes once a year |
| never | Archived page, will not change |
📋 What You Need to Know
Generating the sitemap
The sitemap is generated when you call updateSitemap(body), where body (an ISitemapQuery) provides the baseUrls per language used to build the URLs. It is not produced automatically - you trigger generation explicitly.
Retrieving the sitemap
Use getSitemap() to retrieve the list of generated sitemap URLs (string[]).
Submitting to search engines
The module does not submit directly to search engines. After retrieving the sitemap URLs, submit them via your search engine webmaster tools (Google Search Console, Bing Webmaster Tools, etc.) and keep the sitemap updated after major content changes.
📊 Quick Reference Table
| Method | Description |
|---|---|
| getSitemap() | Get the current sitemap URLs |
| updateSitemap() | Generate/update the sitemap |
❓ Common Questions (FAQ)
How do I submit my sitemap to Google?
Generate sitemaps with updateSitemap(body) (passing your baseUrls), retrieve the resulting sitemap URLs with getSitemap(), then submit a sitemap URL in Google Search Console under Sitemaps.
How often should I update my sitemap?
Update your sitemap whenever you add new pages, significantly update existing content, or change your site structure. For high-traffic sites, consider automated updates triggered by content changes.
What does the priority field mean?
Priority (0.0 to 1.0) is a hint to search engines about the relative importance of pages on your site. The homepage is typically 1.0, category pages 0.8, and individual content pages 0.6–0.7. It is part of the updateSitemap() input and does not affect ranking directly.
🎓 Best Practices
- Regenerate after content changes - Call
updateSitemap()after adding or significantly changing pages. - Set accurate changefreq - Don't claim pages change more often than they do.
- Use meaningful priorities - Homepage > Categories > Products > Blog posts.
- Include all important pages - Don't exclude pages you want indexed.
- Submit after major updates - Notify search engines proactively via webmaster tools.
🔗 Related Documentation
- Pages Module - Manage the pages included in the sitemap
- System Module - System-level API utilities