Loading...
Loading...
When the user wants to create, audit, or optimize sitemap.xml. Also use when the user mentions "sitemap," "sitemap.xml," "sitemap index," "lastmod," "changefreq," "priority," "URL discovery," "URL discovery for search engines," "single source of truth," "URL config," "unify sitemap IndexNow," or "reduce duplicate maintenance."
npx skill4agent add kostja94/marketing-skills xml-sitemap.claude/product-marketing-context.md.cursor/product-marketing-context.mdhttps://example.com| Item | Spec |
|---|---|
| Single sitemap limit | 50,000 URLs, 50MB (uncompressed) |
| Sitemap index | When exceeding limit, split and have main index reference sub-sitemaps |
| Encoding | UTF-8 |
| URL format | Full URL, same host, include |
| Required tags | |
| Optional tags | |
| Field | Description | Recommendation |
|---|---|---|
| url | Full URL | |
| lastModified | Page last modified time | Use page metadata, ISO 8601; use |
| changeFrequency | Update frequency | Home |
| priority | Relative importance | Home 1.0, aggregate pages 0.9, content pages 0.7–0.8, others 0.5–0.6 |
YYYY-MM-DDYYYY-MM-DDTHH:MM:SS+TZD2025-01-152025-01-15T14:30:00+08:00new Date()alwayshourlydailyweeklymonthlyyearlynever/sitemap.xml/sitemap/posts.xml/sitemap/pages.xml/sitemap/zh.xml/sitemap/en.xml/sitemap.xml/sitemap-index.xml<sitemap><loc>...</loc></sitemap>/sitemap/zh.xml/sitemap/en.xml/sitemap/zh-posts.xml/sitemap/en-posts.xmlxhtml:link<url>x-defaultxmlns:xhtml="http://www.w3.org/1999/xhtml"<loc>x-default<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xhtml="http://www.w3.org/1999/xhtml">
<url>
<loc>https://example.com/page</loc>
<xhtml:link rel="alternate" hreflang="en" href="https://example.com/page" />
<xhtml:link rel="alternate" hreflang="zh" href="https://example.com/zh/page" />
<xhtml:link rel="alternate" hreflang="x-default" href="https://example.com/page" />
</url>
</urlset>| Tech Stack | Implementation |
|---|---|
| Next.js App Router | |
| Next.js Pages Router | |
| Astro | |
| Vite / Static build | Build script generates |
| Other | Generate static |
'/((?!api|_next|sitemap|sitemap-index|.*\\..*).*)'//zh/en/api/*/admin/*/_next/*site-pages-config.tsmodifiedDategetAllPageUrls(baseUrl)Sitemap: https://example.com/sitemap.xml<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2025-01-15</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/page</loc>
<lastmod>2025-01-10</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset><?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap/pages.xml</loc>
<lastmod>2025-01-15</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap/posts.xml</loc>
<lastmod>2025-01-14</lastmod>
</sitemap>
</sitemapindex>| Issue | Cause / Fix |
|---|---|
| Sitemap 404 | Build failure, wrong path, incorrect export; check routes and deployment |
| Missing pages | URLs not in data source, filtered or excluded |
| lastmod anomaly | Avoid |
| Google not indexing | Submit sitemap in GSC; check Coverage (google-search-console) and robots |
| EN/ZH URL mismatch | Use unified data source; share same list when generating by locale |