A sitemap is a file that lists URLs you want search engines to discover. It is useful for large websites, recently published pages and content with few internal links. Including a URL does not guarantee that it will be crawled or indexed. Treat a sitemap as one part of site maintenance, alongside internal links, accessible pages and accurate canonical signals.
Choose the URLs first
Start with published pages that should appear in search: useful articles, service pages, categories and relevant product pages. Use absolute URLs on the preferred host and protocol. Check that a representative sample is publicly accessible and returns the expected successful response.
Usually exclude login and cart pages, test environments, redirects, removed documents, pages marked not to be indexed and unwanted parameter variations. Decide which version of a page is preferred and keep the sitemap, internal links and canonical signals consistent.
A sitemap should reflect current content, not become an archive of every URL the site has ever produced. Establish what happens when a product is discontinued or a page is unpublished, then ensure the generator applies that decision.
Create a minimal XML sitemap
The example below uses a fictional domain. Replace the URLs with real pages from your own site:
<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <url> <loc>https://example.com/</loc> </url> <url> <loc>https://example.com/services/</loc> <lastmod>2026-10-20</lastmod> </url> </urlset> The file is UTF-8 XML. The optional lastmod value represents a meaningful modification to the page, not the time a generator happened to run. Omit it if you cannot produce a reliable date. XML special characters must be escaped; for example, an ampersand in a URL is written as & inside XML. URL encoding and XML escaping are separate concerns.
Choose a generation method
A CMS or extension may generate the file automatically. Check the documentation for your version, confirm which page types are included, and open the actual public sitemap. Publish a test page and verify that it appears; unpublish it and verify that the list changes as expected. Avoid competing generators that overwrite the same output.
A custom application can build the sitemap from published records at deployment or on a schedule. Generate the new file safely, validate it and only replace the previous version after success. Alert a responsible person if generation fails rather than replacing a working file with an empty one.
For a small, rarely updated website, a manually maintained sitemap can be sufficient. Assign an owner and update it whenever pages are added or removed. A crawler-based generator can help collect candidates, but review its output: it may miss unlinked pages or include filters and technical URLs.
Know the limits and split when necessary
A single sitemap can contain up to 50,000 URLs and be no larger than 50 MB uncompressed. Larger sites need multiple files. A sitemap index can list those files. Compression saves transfer space but does not remove the uncompressed size limit.
Separating articles, product pages and categories can make troubleshooting easier. Check that every referenced child file is publicly accessible and valid. Location matters: a sitemap's scope and cross-host arrangements have rules, so consult the protocol and your search engine's current documentation before placing a map in a subdirectory or using a different host.
Validate before submission
- Open the public sitemap URL and check for HTTP 200 and actual XML rather than a login or error page.
- Validate syntax, UTF-8, namespaces and escaping.
- Compare host, protocol and preferred URL versions with the live website.
- Sample different page types and look for redirects, 404s, duplicates and pages excluded from indexing.
- Check file limits and every child sitemap referenced by an index.
- Publish and remove a test page to verify the update process.
A browser may display XML as a tree or as text. The presentation alone is not the test; inspect the response and contents. For large sites, rate-limit automated URL checks so the audit does not create unnecessary load.
Submit and monitor
You can advertise the complete sitemap URL in robots.txt using a Sitemap directive. You can also submit it through the verified site's webmaster tools, such as Google Search Console or Yandex Webmaster. Follow the service's current interface and documentation.
Review retrieval and parsing errors after submission. A successful read means the file was processed; it does not mean every page is indexed. Investigate important URLs separately, considering crawl access, page quality, canonical choices, internal links and reporting delays.
Crawl blocking and indexing controls are different mechanisms. Blocking a page in robots.txt can prevent a crawler from seeing a noindex directive on that page. A public sitemap is not an access-control mechanism and should not be used to hide sensitive URLs.
Keep it current
After a migration, compare the sitemap with live preferred addresses. Remove outdated routes from the source list and maintain appropriate redirects. For filters and sorting parameters, decide which variations have independent value before including them. Monitor generation failures and periodically sample newly published and removed content.
A sitemap is most useful when its contents are accurate and its update process is owned. Start by opening your current file, testing a few URLs and checking whether a new page appears as expected. Consult the Sitemaps protocol for format details.
Originally published in Russian: https://morlix.ru/blog/sitemap-xml-kak-sozdat-i-proverit-kartu-sayta
