What is a Sitemap? #
A sitemap is a file where you list important pages, videos, images, and other files on your site, along with their relationships. Search engines like Google use this file to crawl your site more efficiently and understand which content you consider important.
What Information Can a Sitemap Include? #
- When a page was last updated
- Alternate language versions
- Details about videos (duration, rating, age-appropriateness)
- Details about images (location on the page)
- News article info (title, publication date)
Do You Need a Sitemap? #
Google usually finds most pages through internal linking, but a sitemap is helpful in these cases:
- Large sites: When your site has many pages, it’s harder to ensure all pages are linked, so a sitemap helps Google discover new pages faster.
- New sites: Sites with few or no external links benefit from sitemaps because Google crawlers find pages via links on other sites.
- Sites with rich media or news: If you have lots of videos, images, or news content, sitemaps help Google better index this content.
When You Might Not Need a Sitemap: #
- Your site is small (about 500 pages or fewer).
- Your site is well-linked internally (Google can find all important pages via your navigation).
- You don’t have much rich media or news content to show in search results.
Note:
Using popular CMS platforms like WordPress, Wix, or Blogger, your sitemap might already be automatically generated and submitted to search engines.
Build and Submit a Sitemap #
What is a Sitemap?
A sitemap is a file that lists all the important URLs on your site and provides extra info about them to help Google crawl your site better.
How to Build a Sitemap for Google
Google supports several sitemap formats, each with pros and cons. Choose the one that fits your website and technical setup best — Google does not prefer one over the other.
Sitemap Format | Description & Benefits | Pros | Cons |
XML Sitemap | Most versatile format. Supports detailed info about URLs including images, videos, news, and localized pages. | – Extensible and rich with info- CMS plugins often available for auto-generation | – Can be complex to maintain for large or frequently changing sites |
RSS, mRSS, Atom 1.0 | Similar to XML but primarily used for feeds. Often auto-generated by CMS platforms. | – Automatically created by many CMS- Can provide info about videos | – Limited to videos and feeds- Cannot include images or news data |
Text Sitemap | The simplest format, listing only URLs for HTML or indexable pages. | – Very easy to create and maintain- Good for very large sites | – Can only list URLs, no extra info like videos or images |
Submitting Your Sitemap
- Create your sitemap file in one of the supported formats.
- Upload it to your website (usually in the root directory, e.g., https://example.com/sitemap.xml).
- Submit the sitemap URL to Google Search Console under the “Sitemaps” section.
- Monitor the sitemap status and indexing reports in Google Search Console for issues.
Tips:
- Use sitemap plugins available in popular CMS like WordPress to automate creation and updates.
- Update your sitemap regularly if your site content changes often.
- If your sitemap is large, you can split it into multiple smaller sitemap files and use a sitemap index file.
Sitemap Best Practices #
1. Sitemap Size Limits #
- A single sitemap file can contain up to 50,000 URLs or be up to 50 MB uncompressed.
- If your sitemap exceeds these limits, split it into multiple sitemap files.
- Use a sitemap index file to group multiple sitemaps and submit the index to Google.
- You can submit multiple sitemaps or sitemap indexes to Google Search Console to track performance individually.
2. Sitemap File Encoding & Location #
- Sitemap files must be UTF-8 encoded.
- You can host sitemaps anywhere on your domain, but to cover the whole site easily, place sitemaps in the root directory (e.g., https://example.com/sitemap.xml).
- Sitemaps affect crawling only for URLs in their directory and below unless submitted through Search Console.
3. URLs in Sitemap #
- Always use fully-qualified absolute URLs (e.g., https://example.com/page.html), not relative URLs (e.g., /page.html).
- Include only the canonical URLs you want to appear in search results.
- For sites with separate mobile and desktop URLs, either:
- Include just one version in the sitemap, or
- Annotate URLs properly to indicate desktop/mobile versions.
- Include just one version in the sitemap, or
4. XML Sitemap Specifics #
- XML format is versatile, supporting additional info about images, videos, news, and localized content.
- Use <lastmod> tags to show last significant update dates. Google uses this if accurate.
- Ignore <priority> and <changefreq> as Google does not rely on them.
- All tag values must be properly entity escaped (e.g., escape & as &).
<?xml version=”1.0″ encoding=”UTF-8″?>
<urlset xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>
<url>
<loc>https://www.example.com/foo.html</loc>
<lastmod>2022-06-04</lastmod>
</url>
</urlset>
5. RSS, mRSS, and Atom 1.0 Sitemaps #
- Supported by Google, often auto-generated by CMS.
- Good for recent URLs and video content.
- Also require entity escaping.
6. Text Sitemaps #
- Simple list of URLs, one per line.
- Only list URLs, no extra info.
- Must have .txt extension (e.g., sitemap.txt).
How to Create a Sitemap #
- Let your CMS generate it automatically: Most CMS platforms (WordPress, Wix, Blogger) have built-in sitemap features or plugins.
- Manual creation: Suitable for small sites (< a few dozen URLs). Use a text editor and follow sitemap format.
- Automatic generation via tools or custom scripts: Best for larger sites with many URLs.
Submitting Your Sitemap to Google #
- Submit sitemap URLs in Google Search Console under the Sitemaps report.
- You can also:
- Use the Search Console API for automated submissions.
- Use the Search Console API for automated submissions.
Add sitemap location in your robots.txt file like:
Sitemap: https://example.com/sitemap.xml
- Note: Submitting a sitemap is a hint to Google — it doesn’t guarantee crawling or indexing.
Cross-Submitting Sitemaps for Multiple Sites #
If you manage multiple websites:
- Option 1: Create one sitemap containing URLs for all verified sites.
- Option 2: Host individual sitemaps for each site in a single location.
To inform Google:
- Use Search Console to submit these sitemaps.
- Or, reference individual sitemaps in each site’s robots.txt file.
Example for robots.txt:
Sitemap: https://sitemaps.example.com/sitemap-example-com.xml
Managing Sitemaps with a Sitemap Index File #
Why use a Sitemap Index File? #
- When your sitemap exceeds Google’s limits (50,000 URLs or 50MB uncompressed), split it into multiple smaller sitemaps.
- A sitemap index file allows you to submit many sitemaps at once by listing each sitemap in one XML file.
Sitemap Index Best Practices #
- Format: Similar to a standard sitemap XML; follows the Sitemap Protocol.
- Hosting: All sitemaps listed must be hosted on the same site and located in the same or lower directory as the sitemap index file (unless using cross-site submission).
- Example: If your sitemap index is at https://example.com/public/sitemap_index.xml, listed sitemaps should be at:
- https://example.com/public/sitemap1.xml
- or https://example.com/public/shared/sitemap2.xml
- https://example.com/public/sitemap1.xml
- Example: If your sitemap index is at https://example.com/public/sitemap_index.xml, listed sitemaps should be at:
- Limits: You can submit up to 500 sitemap index files per site in Google Search Console.
- Tag requirements: Must include
root, and for each sitemap: - <sitemap> parent tag
- <loc> tag with the sitemap URL (up to 50,000 per index)
- <sitemap> parent tag
- Optional: Use <lastmod> to indicate last modified date of each sitemap (in W3C datetime format).
Example Sitemap Index XML #
<?xml version=”1.0″ encoding=”UTF-8″?>
<sitemapindex xmlns=”http://www.sitemaps.org/schemas/sitemap/0.9″>
<sitemap>
<loc>https://www.example.com/sitemap1.xml.gz</loc>
<lastmod>2024-08-15</lastmod>
</sitemap>
<sitemap>
<loc>https://www.example.com/sitemap2.xml.gz</loc>
<lastmod>2022-06-05</lastmod>
</sitemap>
</sitemapindex>