XML sitemap guide: include the right URLs | ProveFix
مقالات المدونة مكتوبة باللغة الإنجليزية. باقي الموقع متاح بلغتك.
Technical SEO
XML sitemap guide: what to include and how to keep it accurate
An XML sitemap helps search engines find the pages you want indexed. Learn what belongs in it, the limits to respect, and how to keep it accurate after every release.
بقلم Editorial team··قراءة في 3 دقائق·حُدّث في
An XML sitemap is a file that lists the URLs you want search engines to find, with optional details such as when each page last changed. It does not force pages into the index, but it helps crawlers discover new and updated pages faster, especially on large or newly launched sites.
This XML sitemap guide covers what to include, the limits to respect, and how to keep a sitemap accurate as a site changes.
In this guide
What an XML sitemap is
What an XML sitemap example looks like
What to include and what to leave out
XML sitemap limits and sitemap index files
How to submit and monitor your XML sitemap
What is an XML sitemap?
An XML sitemap is a machine-readable list of the canonical URLs on your site, usually found at /sitemap.xml. Search engines use it as a discovery aid alongside the links they find while crawling.
A sitemap helps most when:
The site is new and has few links pointing to it yet.
The site is large, with pages deep in the structure.
Content changes often
, such as news, products or listings.
Pages are poorly linked from the rest of the site.
A small site with good internal links may be found without one, but a clean sitemap costs little and removes doubt.
What does an XML sitemap example look like?
An XML sitemap is a urlset with one url entry per page. Each entry needs a loc with the full URL and can carry a lastmod date.
Google ignores the priority and changefreq fields, so there is no need to tune them. An honest lastmod is the field that helps.
What should an XML sitemap include?
An XML sitemap should include only the URLs you want indexed: canonical pages that return 200 and are not blocked or set to noindex. Every extra URL dilutes the list and makes it harder to trust.
Include
Leave out
Canonical, indexable pages
Redirected URLs
Final URLs on your preferred host and protocol
URLs that return 404, 410 or 5xx
Pages with real content
Pages with a noindex tag
Each language version, if you use hreflang
Duplicates whose canonical points elsewhere
Accurate lastmod dates
Parameter, filter and internal search URLs
XML sitemap limits and sitemap index files
An XML sitemap can hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. Larger sites split their URLs across several sitemaps and list them in a sitemap index file.
Split by type such as pages, posts and products, so problems are easy to trace to one section.
Compress with gzip to save bandwidth; the size limit applies to the uncompressed file.
Keep URLs absolute, using the exact protocol and host of the live site.
Use UTF-8 and escape special characters such as & in URLs.
How to submit and monitor your XML sitemap
Submit your XML sitemap in two places, then monitor it, because sitemaps break quietly when a deploy, a plugin or a CMS setting changes.
Add it to robots.txt with a line such as Sitemap: https://example.com/sitemap.xml. Every crawler that reads the file then knows where to find it. Our robots.txt guide shows where it fits.
Submit it in Google Search Console and in Bing Webmaster Tools, then watch the reported status and discovered URL counts.
Crawl the sitemap URLs. The Website Audit reads your sitemaps and compares them with what it finds by following links, so orphan pages and stale entries stand out.
Check sitemap health. The SEO Issue Checker flags sitemaps that are unavailable, list error or blocked URLs, or change sharply in size, each with proof.
Keep lastmod honest. Update it only when the main content changes. A date that changes on every build teaches search engines to ignore it.
Google's sitemaps overview is the reference for supported formats and limits.
Common XML sitemap mistakes
These XML sitemap mistakes show up in most audits:
Listing redirected or broken URLs, often left over from a migration.
Mixing hosts, such as http:// entries on an https:// site.
Including noindex pages, which sends contradictory signals.
A lastmod that always shows today, which makes the field useless.
A sitemap that returns an error after a deploy, unnoticed for weeks.
The short version
Keep your XML sitemap small and true: canonical, indexable URLs only, absolute addresses, honest lastmod dates and nothing Google is told to skip elsewhere. Submit it in robots.txt, Search Console and Bing, then check it after every release. Make sure each listed page also has a correct canonical tag.
الوسوم
xml sitemap
crawling
indexing
technical seo
أسئلة وأجوبة
Does an XML sitemap guarantee indexing?
No. A sitemap helps search engines discover URLs, but each page is still judged on its own. Pages can be found and still not indexed.
How many URLs can one sitemap hold?
Up to 50,000 URLs or 50 MB uncompressed, whichever comes first. Larger sites use several sitemaps listed in a sitemap index file.
Does Google use priority and changefreq?
No. Google ignores both fields. An accurate lastmod date is the optional field worth maintaining.
Should noindex pages be in the sitemap?
No. Only include canonical pages that return 200 and that you want indexed. Listing noindex or redirected URLs sends mixed signals.
Where should I submit my sitemap?
Add a Sitemap line to robots.txt, and submit it in Google Search Console and Bing Webmaster Tools so you can track its status.