Technical SEO

Submit & Optimize XML Sitemap — Step-by-Step Guide

Generate a clean XML sitemap with all indexable pages. Remove noindexed, redirected, or low-value URLs.

Easy High Impact 20 min Online Local Hybrid
Pro Tip

Include <lastmod> dates only when the content genuinely changed. Updating lastmod without real content changes trains Google to ignore your lastmod signals entirely.

Step-by-Step Guide

1

Generate sitemap via your SEO plugin or tool

In WordPress with Rank Math: go to Rank Math > Sitemap Settings. It auto-generates at /sitemap_index.xml. In Shopify: sitemap is auto-generated at /sitemap.xml. For custom sites: use a generator like xml-sitemaps.com or build dynamically in your framework.

2

Remove any noindexed, redirected, or 404 URLs

Your sitemap should only contain canonical, indexable pages returning a 200 status. Audit it by crawling the sitemap URLs with Screaming Frog: Mode > List > paste sitemap URL.

3

Split into sub-sitemaps if > 50,000 URLs

Google limits sitemaps to 50,000 URLs or 50MB. For larger sites, create a sitemap index file pointing to sub-sitemaps (sitemap-posts.xml, sitemap-products.xml, sitemap-pages.xml). Most SEO plugins do this automatically.

4

Submit via Google Search Console > Sitemaps

In Search Console, go to Sitemaps in the left sidebar. Enter your sitemap URL (e.g., /sitemap_index.xml) and click Submit. Google will confirm receipt and show any errors.

5

Reference sitemap location in robots.txt

Add this line to the bottom of your robots.txt: "Sitemap: https://yourdomain.com/sitemap_index.xml". This helps all search engines discover your sitemap, not just Google.

6

Set up auto-regeneration when content changes

Most SEO plugins auto-regenerate sitemaps when you publish or update content. For custom sites, trigger sitemap regeneration in your CMS's publish hook. Ping Google after updates: https://www.google.com/ping?sitemap=YOUR_SITEMAP_URL.

Video Tutorial

AI Prompt

Act as a technical SEO specialist. Audit my XML sitemap and generate an optimized version.

MY WEBSITE:
- URL: [URL]
- CMS: [WordPress/Shopify/Next.js/Custom]
- Approximate total pages: [NUMBER]
- Current sitemap URL: [SITEMAP URL or "don't have one"]

CURRENT SITEMAP ISSUES (if known):
[PASTE ANY ERROR MESSAGES FROM SEARCH CONSOLE, OR "need full audit"]

GENERATE:
1. A sitemap audit checklist — what to include vs. exclude:
   - Include: Canonical, indexable pages with 200 status
   - Exclude: noindex pages, redirects, 404s, paginated pages, parameter URLs, thin content
2. If my site has multiple content types, suggest a sitemap index structure:
   - sitemap-pages.xml
   - sitemap-posts.xml
   - sitemap-products.xml (if e-commerce)
   - sitemap-images.xml (if image-heavy)
3. Sample XML sitemap code with proper formatting (<lastmod>, <changefreq>, <priority>)
4. Search Console submission checklist
5. How to reference sitemaps in robots.txt
6. Automation recommendations for my CMS to auto-update the sitemap

Tools & Resources

XML Sitemaps GeneratorScreaming Frog

Learn More

XML Sitemaps Guide — ImpressionarticleBuild and Submit a Sitemap — Googleofficial

Do this task in the interactive tool

Track your progress and get guided through every step.

Open Interactive Tool

More in Technical SEO

Enforce HTTPS Sitewide

Easy30 min

Optimize Core Web Vitals

Hard2-5 hrs

Configure Robots.txt Properly

Medium20 min

Implement Canonical Tags

Medium30 min

Fix Broken Links & Redirect Chains

Medium1-2 hrs

Mobile-First Optimization

Medium1-3 hrs

Optimize Page Speed

Hard2-4 hrs

Manage Crawl Budget

Hard1-2 hrs

JavaScript SEO & Rendering

Hard2-4 hrs

Implement Structured Data (Schema)

Medium1-2 hrs

Set Up Hreflang (International Sites)

Hard1-2 hrs

Clean URL Architecture

Medium30 min

Security Monitoring & Headers

Medium30 min