Technical SEO

XML Sitemap: Best SEO Practices for 2026

Share on LinkedIn

Your website may have hundreds of product, category or blog pages, and yet some URLs may still not be discovered by Google. The problem doesn't always come from content quality. A misconfigured XML sitemap can send search engines incomplete or conflicting signals about your important pages.

A properly prepared XML sitemap helps search engines discover the URLs on your website that you want indexed. However, it does not guarantee indexing or rankings on its own. In this guide, we will look at sitemap creation, URL selection, technical validation, Search Console analysis and scalable management methods for large sites, based on Google's 2026 guidelines.

What Is an XML Sitemap and Why Does It Matter for SEO?

An XML sitemap is a machine-readable file that lists the addresses of the pages on a website that you want search engines to discover. It is usually published as sitemap.xml or sitemap_index.xml. In addition to URLs, the file can include the dates of important content updates.

Googlebot discovers web pages mostly by following links. A sitemap is an additional discovery source that supports this process. It becomes especially important for large websites with a weak internal linking structure or content that is updated frequently.

The main SEO use cases of a sitemap are as follows:

  • Discovery of new pages: It makes it easier to notify search engines about newly published products, categories and content.
  • Update signals: It can communicate significant content changes through the last modified date.
  • Management of large sites: It allows thousands of URLs to be tracked in logical groups.
  • Indexing diagnostics: It helps you compare the submitted URLs with Google's indexing status.
  • International content: It supports defining language and region alternates with the appropriate sitemap extensions.

There is an important distinction here: being discovered, being crawled and being indexed are different processes. Google may see a URL in a sitemap but not crawl the page. It may also crawl a page and still not index it because of quality, technical accessibility or canonical evaluation.

For this reason, sitemap work should not be limited to creating a file. In a comprehensive technical SEO optimization process, crawlability, internal links, canonical tags and indexing directives should be evaluated together.

How to Create an XML Sitemap

A sitemap can be prepared manually, generated by a content management system or created dynamically through custom software. The right method depends on the size of your website and how often its content changes.

Basic XML Structure and the Tags Used

A standard file starts with an XML declaration and the urlset root element. Each page is defined inside a url element. The loc field contains the full URL, while the lastmod field indicates the date of the last significant update.

The structure below is a simplified example consisting of two pages:

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

<url>
<loc>https://www.example.com/</loc>
<lastmod>2026-10-20</lastmod>
</url>

<url>
<loc>https://www.example.com/hizmetler/</loc>
<lastmod>2026-10-25</lastmod>
</url>

</urlset>

Keep in mind that the dates used in this example are for illustration only. In a real file, the lastmod value should reflect the last meaningful change made to the page. The XML content should be served with UTF-8 encoding, and special characters should be escaped according to XML rules.

Which Tags Really Matter?

TagFunctionStatus for Google
locSpecifies the full URL of the page.Required.
lastmodReports the date of the last significant change.Can be used if accurate and consistent.
changefreqIndicates the estimated update frequency.Ignored by Google.
priorityIndicates the relative priority of the page.Ignored by Google.

As of 2026, an important principle is to provide reliable data instead of producing unnecessary fields. For example, defining a daily change frequency for every URL does not make Google crawl those pages daily.

Similarly, assigning the highest priority value to all pages creates no ranking advantage. In Google's current approach, reliable lastmod information is far more meaningful.

Manual, Automatic and Dynamic Generation Methods

MethodSuitable Site TypeKey AdvantagePotential Risk
Manual XMLCorporate sites with few pagesFull control over URL selectionUpdates may be forgotten.
CMS pluginWordPress and similar systemsAutomatic generation and updatesWrong content types may be included.
Dynamic generationE-commerce and custom software projectsSynchronization with the databasePerformance and filtering issues
Scheduled generationLarge enterprise platformsControlled and scalable publishingDelay between generation and publication

In custom software projects, the healthiest approach is to generate the URL list based on the publication, indexability and canonical information in the database. Instead of regenerating the file on every request, caching or scheduled generation can be preferred.

Which URLs Should You Include in the Sitemap?

The key criterion of a successful sitemap is not that it contains many URLs, but that it contains the right ones. Keeping pages in the file that you don't want indexed creates unnecessary clutter in Search Console analyses.

As a general rule, the pages included in a sitemap are expected to return a 200 HTTP status code, be indexable and represent the preferred canonical address.

Recommended Pages to Include

  • The homepage and service pages you want to appear in search engines.
  • Category pages with unique and valuable content.
  • Live and indexable product detail pages.
  • Up-to-date blog posts and comprehensive informational content.
  • Corporate landing pages with standalone search value.
  • Correctly configured international language and region alternates.

URL Types That Should Be Excluded

  • Noindex pages: URLs that you don't want shown in search results.
  • Redirects: Old addresses that return a 301 or 302 response.
  • Error pages: URLs that return a 404 or 410 status code.
  • Non-canonical duplicates: Pages that point to another URL as the preferred version.
  • Session and transaction pages: Areas such as cart, checkout, account and login, which generally should not be indexed.
  • Unnecessary parameterized URLs: URLs generated by tracking parameters or repeated filter combinations.

For example, if a product has both a /urun/masa address and a /urun/masa?utm_source=email address, normally only the preferred canonical URL should appear in the sitemap.

An important exception is out-of-stock products. If a product is temporarily sold out but the page still provides value to users and is indexable, it doesn't need to be removed automatically. When a product is permanently discontinued, an appropriate redirect or removal strategy should be applied.

These decisions are especially critical in e-commerce SEO optimization work. A wrong URL filtering policy can make it harder for valuable product and category pages to be discovered in organic search.

Managing XML Sitemaps on Large Websites

On platforms with thousands or millions of URLs, managing everything through a single file can fall short both technically and operationally. For this reason, a split file structure and the use of a sitemap index are recommended for large sites.

The 50,000 URL and 50 MB Limit

According to Google's guidelines, a single sitemap can contain at most 50,000 URLs or 50 MB of data when uncompressed. Whichever limit is reached first, the file must be split at that point.

For example, on an e-commerce site with 120,000 indexable URLs, the content can be divided as follows:

  • product-sitemap-1.xml: The first 40,000 products.
  • product-sitemap-2.xml: The next 40,000 products.
  • product-sitemap-3.xml: The remaining 40,000 products.
  • category-sitemap.xml: Category pages.
  • blog-sitemap.xml: Blog content.

These files can be listed in sitemap_index.xml. This way, a single index file is submitted to Search Console, which makes it easier to manage the child sitemaps.

Splitting at 40,000 URLs is not a technical requirement; it was chosen in the example to leave a safe capacity margin. The actual splitting strategy should be determined by file size, content volume and update frequency.

Segmentation by Content Type

Instead of splitting based only on URL count, separating content types makes it easier to identify the source of errors. For example, tracking product and category sitemaps separately helps show which page group has concentrated indexing issues.

On international websites, segmentation by country or language can also be applied. hreflang relationships can be defined using the XML sitemap extensions supported by Google. It is important to specify alternate URL groups consistently and reciprocally.

Similarly, you can use the special sitemap extensions supported by Google for image, video and news content. However, it is not mandatory to keep each content type in a separate file; the decision should be based on ease of management.

Sitemap Management During Site Migrations

When the domain, URL structure or platform changes, old and new addresses need to be mapped. While the new sitemap supports the discovery of the target URLs, permanent redirects explain the transition from old addresses to new ones.

Accidentally adding old, redirecting URLs to the new sitemap during a migration is a common mistake. To manage the process correctly, the redirect map, canonical checks and index monitoring should be handled together in your site migration SEO plan.

Checking Your Sitemap with Google Search Console

The file existing on the server does not mean it has been processed successfully by Google. That is why you should submit and monitor it through Google Search Console.

Steps for Submitting a Sitemap

  1. Open the relevant website property in your Google Search Console account.
  2. From the left menu, go to the Sitemaps report under Indexing.
  3. Enter the sitemap.xml or sitemap_index.xml address in the add a new sitemap field.
  4. Submit the file and check the reported processing status.
  5. Review the last read date and any reported errors.
  6. Verify the indexing status of sample pages with the URL Inspection tool.

Alternatively, you can add the line Sitemap: https://www.example.com/sitemap.xml to your robots.txt file. Google can discover this address through robots.txt. For configuration details on this topic, you can check our guide to creating a robots.txt file.

Which Metrics Should You Track?

While the Search Console Sitemaps report shows the processing status of the file, the Page Indexing report is used to evaluate the indexing status of URLs. These two reports should be interpreted together.

Check AreaData to MonitorPossible Action
File accessFetch and processing statusCheck the server response and XML format
Submitted URLsNumber of discovered URLsCompare with the generated URL list
IndexingIndexed and non-indexed pagesClassify the reasons for exclusion
CanonicalGoogle-selected canonical addressEnsure on-site canonical consistency
CrawlingLast crawl information and access issuesInvestigate server and crawlability problems

For example, if a file reports 8,000 indexable URLs and only 5,000 URLs of the relevant page group are indexed, the remaining 3,000 URLs should not automatically be treated as errors. First, you need to determine which pages have not yet been crawled, which are being treated as duplicates and which have content quality issues.

The indexing rate should be calculated on page groups compared within the same scope and date range. A planned SEO audit and reporting approach yields more reliable results for this.

The Most Common XML Sitemap Mistakes and Their Solutions

Some sitemap errors stem directly from the file format, while others come from incorrect URL selection. Both dimensions should be examined during technical validation.

1. Noindex or Canonical Conflicts

When a page in the sitemap carries a noindex directive, it creates a conflict among the indexing signals you send. Similarly, if a canonical tag points to another URL while the alternate URL appears in the sitemap, it creates an inconsistency.

The solution is to compare the URL list against the pages' actual indexability and canonical data. Also remember that the final canonical selection is made by Google.

2. Incorrect lastmod Dates

Systems that update the last modified date of all URLs every night can make content that hasn't really changed look as though it was updated. Google can check the accuracy of this kind of data and may ignore dates it doesn't find reliable.

Update lastmod only when the main content, structured data or meaningful links on the page change. A change in the copyright year alone is not a sufficient reason.

3. Inaccessible or Broken Files

Processing can be blocked if the sitemap returns a 404 or 5xx response, contains broken XML, or cannot be served to Googlebot because of misconfigured security rules.

Check the file's HTTP response, content type, XML syntax and server logs. If you use a CDN or a firewall, verify that Googlebot requests are not being blocked by mistake.

4. Unnecessary URL Generation

On e-commerce sites, filter, sorting and tracking parameters can create many alternate addresses. Adding these addresses to the file without control makes it harder to identify valuable pages and analyze indexing.

Apply URL normalization at the generation stage. HTTP/HTTPS, www usage, trailing slashes and canonical preferences should be consistent across the site.

5. Static Files That Are Not Updated

A system where new products are added but the sitemap is not updated can miss additional opportunities in the discovery process. Automatic updating is especially important on platforms where content changes frequently.

Set up a workflow that updates the relevant sitemap when a new URL is published or an existing URL is permanently removed. Log the file's generation date and any failed generation jobs.

XML Sitemap Optimization Checklist for 2026

For a sitemap to remain sustainable, regular audits are needed after the initial setup. The list below is a practical framework that technical teams can use in monthly checks or after major updates.

Technical Checklist

  • The sitemap is accessible and in valid XML format.
  • The file is published with UTF-8 encoding.
  • URLs are defined with full, preferred HTTPS addresses.
  • Indexable pages have been selected and noindex pages excluded.
  • Redirecting and error-returning URLs have been cleaned up.
  • Canonical addresses and sitemap addresses are consistent.
  • lastmod values represent real and significant changes.
  • The 50,000 URL and 50 MB limits are not exceeded.
  • Large files have been split appropriately.
  • Submission and processing status have been checked in Search Console.
  • New and removed URLs are updated automatically.
  • Non-indexed URL groups are analyzed by reason.

A Realistic E-Commerce Scenario

Let's consider an e-commerce site with 25,000 products and 600 category pages. During an audit, the sitemap is found to contain 34,000 URLs. The difference is traced to filter parameters, old product addresses and redirects.

In the first stage, the pages that return a 200 response, are indexable and are preferred as canonical are identified. Then the product and category files are separated, the lastmod fields are matched with real update records, and the files are submitted to Search Console.

In the next stage, the goal is not just to reduce the number of submitted URLs. You need to compare the indexing status of the cleaned-up URL groups, their organic impressions and the discovery processes of the product pages.

The success of this work should not be measured by promising a specific increase in indexing. The reduction in technical errors, the consistency of reports and the discoverability of important pages are more meaningful starting indicators.

Measurement and Monitoring Frequency

The frequency of checks should be determined by how fast the website changes. For rarely updated corporate sites, a monthly check may be enough, while for platforms with thousands of product changes per day, automated daily validation may be more appropriate.

Additional audits should be carried out especially after URL structure changes, large content cleanups, CMS migrations and domain moves. Instead of repeatedly sending notifications through Google's legacy sitemap ping endpoint, rely on Search Console, robots.txt and up-to-date file management.

When evaluating technical results, remember that a sitemap alone does not increase organic traffic. Content quality, page experience, internal linking architecture and alignment with search intent must work together.

Frequently Asked Questions

Does an XML sitemap improve Google rankings?

A sitemap is not a direct ranking factor and does not increase organic rankings on its own. It contributes to technical SEO work by supporting search engines in discovering important URLs. The indexing decision, however, depends on Google's evaluation.

How often should a sitemap be updated?

The update frequency depends on content changes. The relevant file should be updated when a new page is published, when the important content of an existing page changes or when a URL is removed. It is not necessary to change the date of all URLs every day.

Can a website have more than one sitemap?

Yes, a website can have multiple sitemaps. Especially on large sites, it is useful to manage product, category and blog URLs in separate files. The files can be served together through a sitemap index.

What is the maximum number of URLs in an XML sitemap?

A single sitemap supported by Google can contain at most 50,000 URLs or 50 MB of data when uncompressed. When either limit is exceeded, the file must be split. Multiple files can be managed through a sitemap index.

Are robots.txt and a sitemap the same thing?

No, the two files have different functions. Robots.txt manages compliant search engine crawlers' access to specific URL paths, while a sitemap lists the addresses you want discovered. The location of the sitemap can also be specified in the robots.txt file.

Why aren't pages indexed even though the sitemap has been submitted?

Pages may not be indexed because of a noindex directive, canonical selection, access issues, duplicate content or quality evaluations. A successfully processed sitemap does not mean all URLs will be indexed. The source of the problem should be investigated with Search Console's indexing reports and the URL Inspection tool.

Conclusion: An XML Sitemap Is an SEO Component That Needs Ongoing Management

A properly configured XML sitemap gives search engines clean, up-to-date and consistent URL information. It is an important technical component that supports the discovery process, especially on large e-commerce sites, platforms that publish content frequently and corporate web projects.

In 2026, the best approach is not to list as many URLs as possible; it is to select indexable pages correctly, maintain canonical consistency, use reliable update dates and regularly analyze Search Console data.

Want to improve your website's technical SEO foundation? At Seo Performans, we offer data-driven solutions for sitemap audits, crawlability analysis, identifying indexing issues and technical improvement processes. To build a roadmap that fits your site's needs, you can contact the Seo Performans team.

A free tool for this topic XML Sitemap Generator Build a valid sitemap.xml from your URL list. Open tool

Latest Posts