How to Create an XML Sitemap Manually (Without Plugins or Tools)

XML Sitemap Extensions_ Video, Image, and News Sitemaps Explained

Create XML Sitemaps Manually: Step-by-Step Guide

Understanding the Basic Structure

Required Components

Every XML sitemap needs:

  1. XML declaration(first line)
  2. URLset container(wraps all URLs)
  3. Individual URL entries

Basic Template

xml

Copy

Download

Run

<?xml version=”1.0″ encoding=”UTF-8″?>

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>

<!– URL entries go here –>

</urlset>

Step-by-Step Creation Process

Step 1: List Your Important URLs

Prioritize:

  • Homepage
  • Key category/service pages
  • High-traffic blog posts
  • Product pages (for e-commerce)

Exclude:
❌ Pagination pages beyond page 2-3
❌ Duplicate content (filtered/sorted URLs)
❌ Private pages (login, admin)

Step 2: Create the File

  1. Open a text editor (Notepad, VS Code, etc.)
  2. Start with the XML prolog:

xml

Copy

Download

Run

<?xml version=”1.0″ encoding=”UTF-8″?>

Step 3: Add the URLset Container

xml

Copy

Download

Run

<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>

Step 4: Add URL Entries

For each important page:

xml

Copy

Download

Run

<url>

<loc>https://example.com/page-url/</loc>

<lastmod>2023-11-20</lastmod>

<changefreq>monthly</changefreq>

<priority>0.8</priority>

</url>

Step 5: Save the File

  1. Save as sitemap.xml
  2. UTF-8 encoding (critical for special characters)
  3. Advanced Techniques
  4. Multiple Sitemaps (50,000+ URLs)

Create a sitemap index file:

xml

Copy

Download

Run

<?xml version=”1.0″ encoding=”UTF-8″?>

<sitemapindex xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>

<sitemap>

<loc>https://example.com/sitemap-posts.xml</loc>

<lastmod>2023-11-20</lastmod>

</sitemap>

</sitemapindex>

Dynamic Content Handling

For frequently updated sites, add:

xml

Copy

Download

Run

<lastmod>2023-11-20</lastmod>

<changefreq>daily</changefreq>

Image & Video Extensions

Example for product images:

xml

Copy

Download

Run

<url>

<loc>https://example.com/product</loc>

<image:image>

<image:loc>https://example.com/product.jpg</image:loc>

</image:image>

</url>

 

Check XML Syntax

Use:

Verify URLs

bash

Copy

Download

# Linux/Mac:

wget –spider -i sitemap.xml 2>&1 | grep ‘^http’

 

# Windows (PowerShell):

Select-String -Path sitemap.xml -Pattern ‘<loc>’ | ForEach { Invoke-WebRequest $_.Matches.Groups[1].Value -Method Head }

  1. Submit to Search Engines
  2. Google Search Console> Sitemaps
  3. Bing Webmaster Tools
  4. Add to robots.txt:

Copy

Download

Sitemap: https://example.com/sitemap.xml

Maintenance Best Practices

✔ Update after major content changes
✔ Remove discontinued pages
✔ Monitor Search Console for errors
✔ Revalidate monthly

Manually creating an XML sitemap:
✅ Ensures only high-quality pages are included
✅ Provides better control than automated tools
✅ Improves crawl efficiency

Next Steps:

  1. Create your first sitemap today
  2. Validate using free tools
  3. Submit to search engines