{"id":793,"date":"2022-09-12T18:32:20","date_gmt":"2022-09-12T18:32:20","guid":{"rendered":"https:\/\/glossary.dream.press\/glossary\/%group%\/xml-sitemap\/"},"modified":"2026-08-09T12:09:43","modified_gmt":"2026-08-09T12:09:43","slug":"xml-sitemap","status":"publish","type":"glossary","link":"https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/","title":{"rendered":"XML Sitemap"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Most websites benefit from an XML sitemap because it helps Google find your most important web pages. Finding isn\u2019t the same as appearing, though. The file helps search engines discover the URLs you list, but it guarantees neither crawling nor <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/index\/\">indexing<\/a>: Google decides both on its own, and only pages it indexes are eligible to appear in search results. For instance, a page with no <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/internal-link\/\">internal link<\/a> pointing to it is difficult for <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/crawling\/\">crawlers<\/a> to reach. An XML sitemap hands Google that URL directly, along with when the page last changed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An XML sitemap is especially useful for large websites with deep archives and rich media, and for new websites that few external links point to yet. <a href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/sitemaps\/overview\">Google\u2019s sitemap documentation<\/a> draws the line at about 500 pages: below that, if every page can be reached by following links from your homepage, you probably don\u2019t need one. For when a site needs a sitemap at all, and the other formats search engines accept, see our <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/sitemap\/\">sitemap<\/a> entry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Inside an XML sitemap file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An XML sitemap is a plain text file, and the format is strict on only a few points. The file must be UTF-8 encoded, it opens with a &lt;urlset&gt; tag that declares the protocol namespace, and each page gets its own &lt;url&gt; entry. Here\u2019s a complete one-entry sitemap, based on the sample in the <a href=\"https:\/\/www.sitemaps.org\/protocol.html\">sitemaps.org protocol<\/a>:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;<br>&lt;urlset xmlns=&#8221;http:\/\/www.sitemaps.org\/schemas\/sitemap\/0.9&#8243;&gt;<br>&nbsp;&nbsp;&lt;url&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;loc&gt;https:\/\/www.example.com\/&lt;\/loc&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;lastmod&gt;2026-08-01&lt;\/lastmod&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;changefreq&gt;monthly&lt;\/changefreq&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;priority&gt;0.8&lt;\/priority&gt;<br>&nbsp;&nbsp;&lt;\/url&gt;<br>&lt;\/urlset&gt;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>&lt;urlset&gt; (required) wraps the file and names the protocol standard in use.<\/li>\n\n\n\n<li>&lt;url&gt; (required) is the parent tag for each page entry.<\/li>\n\n\n\n<li>&lt;loc&gt; (required) is the page\u2019s full URL, protocol included, under 2,048 characters.<\/li>\n\n\n\n<li>&lt;lastmod&gt; (optional) is the date the page last changed, in W3C Datetime format such as 2026-08-01.<\/li>\n\n\n\n<li>&lt;changefreq&gt; (optional) says how often the page is likely to change, from always down to never.<\/li>\n\n\n\n<li>&lt;priority&gt; (optional) ranks the page against your other pages, from 0.0 to 1.0; the default is 0.5.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Treat the last two as hints, not commands. The protocol itself warns that priority \u201cis not likely to influence the position of your URLs\u201d in search results; it only helps crawlers choose among pages on your own site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Size limits and file location<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">One sitemap file can hold at most 50,000 URLs and must be no larger than 50MB (52,428,800 bytes). Bigger sites split their URLs across several sitemap files and reference them from a sitemap index file, which can itself list up to 50,000 sitemaps and has the same 50MB cap. Gzip compression is allowed if the file gets heavy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Put the file at your site root, such as example.com\/sitemap.xml; the protocol strongly recommends it. Location sets scope: a sitemap in a subfolder can only describe URLs in that folder and below, so the root covers your whole site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XML sitemaps vs. HTML sitemaps<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">An HTML sitemap is a regular web page that lists links to your site\u2019s pages so human visitors can browse its structure. It\u2019s navigation, not a crawler file: search engines treat it like any other page, not as a sitemap format they accept for submission. The decision rule is simple. Use an XML sitemap to hand crawlers your URLs and their metadata; add an HTML sitemap when visitors need a browsable overview of a large site. The two do different jobs, and one doesn\u2019t replace the other, so plenty of sites use both.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Image, video, and news extensions<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">XML\u2019s advantage over the plain text, RSS, and Atom formats search engines also accept is that it\u2019s extensible. <a href=\"https:\/\/developers.google.com\/search\/docs\/crawling-indexing\/sitemaps\/build-sitemap\">Google\u2019s format comparison<\/a> calls XML sitemaps \u201cthe most versatile\u201d of the formats: an entry can carry extra data about the images, video, and news content on a page, such as a video\u2019s running time or an article\u2019s publication date, plus the localized versions of a page in other languages. If image, video, or news search matters to your site, XML entries are how you describe that content to Google.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Common XML sitemap mistakes<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A sitemap should list the pages you want indexed: for each one, its preferred <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/canonical-url\/\">canonical URL<\/a>, returning a successful response and open to crawlers. Most sitemap problems live in the URLs, not the XML around them. The usual suspects:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Redirects and error pages: a URL that redirects or returns a 4xx or 5xx error gives Google nothing to index at the listed address. List each page\u2019s final, working URL instead.<\/li>\n\n\n\n<li>Noindex pages: a <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/noindex-tag\/\">noindex tag<\/a> tells search engines to keep a page out of results, so a sitemap entry for it spends crawl time on a page that can\u2019t appear. Remove the URL from the file, or remove the tag if the page belongs in search.<\/li>\n\n\n\n<li>Duplicate and noncanonical versions: list each page once, at its preferred URL. Including both the http and https versions may leave your site incompletely crawled, and every extra variant makes Google guess which one you want indexed.<\/li>\n\n\n\n<li>Blocked URLs: if robots.txt blocks a URL, crawlers can\u2019t read the page, so the sitemap entry becomes an error in your reports rather than a result in search.<\/li>\n\n\n\n<li>Wrong host: every URL must live on the same host as the sitemap file itself.<\/li>\n\n\n\n<li>Partial URLs: each one must be fully specified, protocol included. https:\/\/www.example.com\/ is valid; www.example.com isn\u2019t.<\/li>\n\n\n\n<li>Session IDs: strip them from URLs, or crawlers waste time on redundant copies of the same page.<\/li>\n\n\n\n<li>Stale lastmod: set it to the date the page actually changed, never the date the sitemap was generated.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If something looks off, validate the file first; the protocol publishes an XML schema for exactly that. Then check the errors <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/google-search-console\/\">Google Search Console<\/a> reports for your sitemap after you submit it, and fix the URLs it flags.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Creating and submitting an XML sitemap<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll rarely write this file by hand. Most CMSs generate an XML sitemap automatically; WordPress has published one at yoursite.com\/wp-sitemap.xml since version 5.5 in 2020, and SEO plugins and standalone generators cover the rest. Once the file exists, tell search engines where it lives: submit its URL in <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/google-search-console\/\">Google Search Console<\/a>, or add a Sitemap: line to your <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/robots-txt-file\/\">robots.txt file<\/a> so that Google, Bing, and any other crawler that supports the directive can find it without an account. Set it up once, and your CMS keeps the file current.<\/p>\n","protected":false},"featured_media":0,"parent":0,"menu_order":0,"template":"","meta":{"_acf_changed":false,"_yoast_wpseo_focuskw":"","_yoast_wpseo_title":"What is an XML Sitemap? %%sep%% %%sitename%%","_yoast_wpseo_metadesc":"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":""},"group":[20],"class_list":["post-793","glossary","type-glossary","status-publish","hentry","group-seo"],"acf":{"cta":"SEO Marketing","faqs":[{"question":"Does an XML sitemap guarantee my pages get indexed?","answer":"No. The protocol defines its optional fields as hints, and listing a URL doesn\u2019t force Google to crawl or index it. If an important page stays out of the index, fix the page; our <a href=\"https:\/\/www.dreamhost.com\/glossary\/seo\/sitemap\/\">sitemap<\/a> entry explains why a sitemap is only a hint."},{"question":"Can one XML sitemap include URLs from a subdomain?","answer":"No. Every URL must live on the same host as the sitemap file, so a sitemap at www.example.com\/sitemap.xml can\u2019t list pages on store.example.com. Publish a separate sitemap on each subdomain instead."},{"question":"Do I need an XML sitemap if I already have a robots.txt file?","answer":"They do different jobs, so most sites use both. A robots.txt file tells crawlers what to stay out of; a sitemap lists what you want found. They meet in one place: a Sitemap: line in robots.txt is a standard way to publish your sitemap\u2019s location."},{"question":"Does my sitemap have to be named sitemap.xml?","answer":"No. The name is a convention, not a rule. The protocol recommends placing the file at your site root, like example.com\/sitemap.xml, but WordPress names its own wp-sitemap.xml. Whatever the name, submit the exact URL in Google Search Console or list it in robots.txt."}],"term_definition":"An XML sitemap is a machine-readable XML file that lists a website\u2019s important URLs, with optional details like each page\u2019s last-modified date. Search engines read it to discover and crawl pages they might otherwise miss. It follows the sitemaps.org protocol and is the format most CMSs and SEO plugins generate automatically.","h2_more":"More About XML Sitemaps","title_tag":"What is an XML Sitemap?"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is an XML Sitemap? - DreamHost Glossary<\/title>\n<meta name=\"description\" content=\"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is an XML Sitemap? - DreamHost Glossary\" \/>\n<meta property=\"og:description\" content=\"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/glossary\/seo\/xml-sitemap\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Glossary\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-09T12:09:43+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is an XML Sitemap? - DreamHost Glossary","description":"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"What is an XML Sitemap? - DreamHost Glossary","og_description":"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.","og_url":"https:\/\/www.dreamhost.com\/glossary\/seo\/xml-sitemap\/","og_site_name":"DreamHost Glossary","article_modified_time":"2026-08-09T12:09:43+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/","url":"https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/","name":"What is an XML Sitemap? - DreamHost Glossary","isPartOf":{"@id":"https:\/\/glossary.dream.press\/glossary\/#website"},"datePublished":"2022-09-12T18:32:20+00:00","dateModified":"2026-08-09T12:09:43+00:00","description":"What is an XML sitemap? See what the file looks like, the 50,000-URL and 50MB limits, common mistakes to avoid, and how to submit yours to Google.","breadcrumb":{"@id":"https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/glossary.dream.press\/glossary\/seo\/xml-sitemap\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/glossary\/"},{"@type":"ListItem","position":2,"name":"Terms","item":"https:\/\/www.dreamhost.com\/glossary\/%group%\/"},{"@type":"ListItem","position":3,"name":"XML Sitemap"}]},{"@type":"WebSite","@id":"https:\/\/glossary.dream.press\/glossary\/#website","url":"https:\/\/glossary.dream.press\/glossary\/","name":"DreamHost Glossary","description":"","publisher":{"@id":"https:\/\/glossary.dream.press\/glossary\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/glossary.dream.press\/glossary\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/glossary.dream.press\/glossary\/#organization","name":"DreamHost","url":"https:\/\/glossary.dream.press\/glossary\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/","url":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","contentUrl":"https:\/\/glossary.dream.press\/glossary\/wp-content\/uploads\/2022\/10\/dreamhost-glossary-social.jpg","width":2400,"height":1256,"caption":"DreamHost"},"image":{"@id":"https:\/\/glossary.dream.press\/glossary\/#\/schema\/logo\/image\/"}}]}},"lang":"en","translations":{"en":793,"es":1534,"fr":7912,"nl":7957,"it":8773,"pt":10124,"pl":10146,"de":10163,"ru":10384,"uk":10411},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/glossary"}],"about":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/types\/glossary"}],"wp:attachment":[{"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/media?parent=793"}],"wp:term":[{"taxonomy":"group","embeddable":true,"href":"https:\/\/glossary.dream.press\/glossary\/wp-json\/wp\/v2\/group?post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}