XML sitemaps are essential for helping search engines discover and index your website's content efficiently. While many tools can generate sitemaps automatically, understanding how to create them manually gives you complete control over what gets indexed and how search engines crawl your site.
In this comprehensive guide, we'll walk through the process of creating an XML sitemap from scratch, covering everything from basic syntax to advanced optimization techniques.
Understanding XML Sitemap Structure
An XML sitemap is a structured file that lists all the important pages on your website, along with metadata about each page. The basic structure follows the Sitemap Protocol, which uses specific XML tags to organize information.
The fundamental components of an XML sitemap include:
- URL location (loc): The full URL of the page
- Last modification date (lastmod): When the page was last updated
- Change frequency (changefreq): How often the page content changes
- Priority (priority): The relative importance of the page compared to other pages on your site
Basic XML Declaration
Every XML sitemap must start with the proper XML declaration and namespace. Here's the standard opening structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
Step-by-Step Manual Creation Process
1. Plan Your Sitemap Content
Before writing any code, identify which pages should be included in your sitemap. Focus on:
- Main navigation pages
- Important product or service pages
- Blog posts and articles
- Landing pages
- Any page you want search engines to prioritize
Exclude pages like admin areas, duplicate content, or pages blocked by robots.txt.
2. Create the XML Structure
Start with a basic text editor or code editor and begin building your sitemap. Here's a complete example for a simple website:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/</loc>
<lastmod>2026-01-15</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://example.com/about/</loc>
<lastmod>2026-01-10</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
3. Optimize Each URL Entry
For each page, carefully consider the metadata values:
- Priority: Use 1.0 for your homepage, 0.8-0.9 for main pages, and 0.5-0.7 for secondary content
- Change frequency: Choose realistic values (daily, weekly, monthly, yearly, never)
- Last modification: Use the actual last update date in YYYY-MM-DD format
Advanced Sitemap Features
Image Sitemaps
Include image information to help search engines discover your visual content:
<url>
<loc>https://example.com/gallery/</loc>
<image:image>
<image:loc>https://example.com/image.jpg</image:loc>
<image:caption>Image description</image:caption>
</image:image>
</url>
Video Sitemaps
For video content, add video-specific metadata:
<url>
<loc>https://example.com/video-page/</loc>
<video:video>
<video:thumbnail_loc>https://example.com/thumb.jpg</video:thumbnail_loc>
<video:title>Video Title</video:title>
<video:description>Video description</video:description>
</video:video>
</url>
Best Practices for Manual Sitemap Creation
File Size and Organization
Keep your sitemap under 50MB and limit it to 50,000 URLs. For larger sites, create multiple sitemaps and use a sitemap index file to organize them.
URL Format Guidelines
- Use absolute URLs (include the full domain)
- Escape special characters properly (&, <, >, ", ')
- Use consistent URL formatting (trailing slashes, www vs non-www)
- Include only canonical URLs to avoid duplicate content issues
Validation and Testing
Before uploading your sitemap, validate it using:
- Online XML validators
- Google Search Console's sitemap testing tool
- Manual review for syntax errors
Tools like SiteRadar can help you analyze your sitemap implementation and identify potential issues with your website's SEO structure.
Deployment and Submission
File Placement
Save your sitemap as 'sitemap.xml' and upload it to your website's root directory. The standard location is: https://yoursite.com/sitemap.xml
robots.txt Integration
Add your sitemap location to your robots.txt file:
Sitemap: https://yoursite.com/sitemap.xml
Search Engine Submission
Submit your sitemap to major search engines:
- Google Search Console
- Bing Webmaster Tools
- Yandex Webmaster
Maintenance and Updates
Regular sitemap maintenance is crucial for SEO success. Update your sitemap whenever you:
- Add new pages or content
- Remove or redirect pages
- Make significant content changes
- Change your site structure
Consider automating the update process if your site changes frequently, but manual creation gives you precise control over what gets indexed.
What is an XML sitemap?
An XML sitemap is a file that lists all the important pages on your website to help search engines discover and index your content more efficiently. It contains URLs along with metadata like last modification dates, change frequency, and priority levels. XML sitemaps follow the standardized protocol defined by sitemaps.org and can include up to 50,000 URLs per file.
How often should I update my XML sitemap?
Update your XML sitemap whenever you add new pages, remove content, or make significant changes to existing pages. For blogs or news sites that publish daily, consider updating weekly. E-commerce sites should update monthly or when product catalogs change significantly. Static business websites may only need quarterly updates unless new services or pages are added.
What is the maximum file size for an XML sitemap?
XML sitemaps must not exceed 50MB in uncompressed size and cannot contain more than 50,000 URLs. If your website exceeds these limits, create multiple sitemap files and organize them using a sitemap index file. Each individual sitemap within the index must also follow the same size and URL count restrictions.
How do I validate my manually created XML sitemap?
Validate your XML sitemap using online XML validators to check syntax errors, then test it in Google Search Console's sitemap tool for SEO-specific issues. Manually review for proper URL formatting, correct date formats (YYYY-MM-DD), and escaped special characters. Test all URLs to ensure they return 200 status codes and are accessible to search engines.
Should I include all pages in my XML sitemap?
Include only important, indexable pages in your XML sitemap. Add main navigation pages, product pages, blog posts, and landing pages. Exclude admin areas, duplicate content, pages with noindex tags, login pages, and any content blocked by robots.txt. Focus on pages that provide value to users and align with your SEO strategy rather than including every page on your site.
Creating XML sitemaps manually provides unparalleled control over how search engines discover and crawl your website. While it requires more effort than automated solutions, the precision and customization options make it worthwhile for serious SEO practitioners. Remember to validate your sitemap thoroughly, submit it to search engines, and maintain it regularly to maximize your website's search visibility in 2026.
Discover SiteRadar
Analyze your website for free with our SEO, performance and security audit tool.
View pricing →