How many links can a site map contain, and how do you split them if you exceed the limit?
How many links can a sitemap file contain? The protocol document specifies the capacity limit rather than a recommended value: Each sitemap file may not contain more than 50,000 URLs, and the uncompressed file size may not exceed 50MB. If the quantity exceeds this, multiple files must be created, and the sitemap index is used to list the fragments. The index file itself is subject to the same number and volume limit constraints, so the 'split' operation can be done at most two levels deep, and cannot be solved by infinite nesting.
The protocol specifies the capacity limit rather than a recommended value.
This limit is easily read as 'recommend controlling within how many items,' but it is actually a strict constraint: files exceeding the limit are non-compliant, and the fetching party may directly refuse to read the entire file, rather than just ignore the excess parts. The volume limit is the same, and it is explicitly aimed at the contents after decompression - even if compressed for transmission, the limit is still exceeded after expansion.
Therefore, the correct way to read it is: first deduce the number of slices based on the limit, and then consider how to slice it well for maintenance. It is feasible to put all the addresses into one file when the site scale is small, but once it exceeds the limit, the entire file becomes invalid, with much greater risk than expected.
What does the index file bear during splitting?
After splitting, a sitemap index is needed, which lists the addresses and last modification times of each shard file. Its purpose is to provide a stable entry for the crawler: only the index needs to be updated when shards are added or removed, and the addresses submitted to the search engine do not need to be changed.
| Hierarchy | What to put | What restrictions | Change frequency |
|---|---|---|---|
| Piece files | A set of specific page addresses | Number and volume limit | Changes accordingly when content is added or deleted |
| Index file | Addresses of each shard file | Number and volume limit of subfiles | Changed only when the shard structure changes |
| In-site entry | The address for the index or a single shard | None | Attempt to keep it fixed for a long time |
Control the growth of the index file: Each shard should contain very few addresses to prevent the index itself from becoming lengthy. A reasonable goal is to make the shard size close to the limit but leave room for growth.
A reasonable slicing method for shards
Two slicing methods are most common, with a big difference in choice. Slicing by time (by month or year) is simple to implement, but it will lead to uneven distribution: new columns grow quickly, old archives remain inactive for a long time, and in the end, there are both over-limited slices and almost empty slices. Slicing by column is easier to maintain balance and is more in line with content management logic - the number of addresses of each column has a natural boundary, and it is clear to investigate the scope when a problem occurs.
In scenarios with multilingual and multisite, it is recommended to add an additional dimension: slice by site, and within the site, slice by column. Mixing cross-site slices in one will make it difficult to judge the impact of a single point of failure.
Pay attention not to leave addresses that should not appear on the list. The document status of AnQiCMS is divided into formal, draft, pending release, and recycling bin. Deleting a formal document is to move it to the recycling bin rather than physically deleting it. When generating a site map, only the formal addresses visible to the outside should be included, and mixing in draft and recycling bin content is equivalent to actively exposing internal paths, which will also bring a large number of error responses.
Who generates the site map within the site?
The manual maintenance list becomes unrealistic when the content volume increases. AnQiCMS supports automatic generation of site maps, with changes in columns and documents directly entering the list, fields are given uniformly according to the rules within the site, and this step also ensures the consistency of the slice structure.
After generation, two things still need to be manually checked: whether the file size is close to the limit and the direction of the old addresses. For sites that have made adjustments to the address rules or column migration, it is also necessary to check whether historical addresses have been arranged for redirection, AnQiCMS supports 301 redirect management to set address redirection, and only when the old addresses are taken over will there be a large number of invalid entries left in the list.
Push notifications and sitemap are two channels that cannot be substituted for each other. The sitemap is a complete list, and the crawling party visits at their own pace; link submission is for specific changes. AnQiCMS's link submission management supports Baidu and Bing push notifications, new content is submitted through push notifications, historical and full-scale verification goes through the sitemap, each playing its role.
Common questions
If it's just about to reach the limit, should we split it in advance?Yes. If a growing site stops at the critical value, a single batch import may fail completely, and splitting in advance is more stable.
Can an index file point to another index file?Do not design it this way. The layering of the protocol points to a specific list, and multiple nesting makes it difficult to verify the structure.
Can gzip compression bypass the volume limit?No. The limit is for the decompressed volume, and compression only reduces transmission overhead.
Should the chunk address be submitted to the search engine at the same time?Just submit the entry point of the index, the crawler will read each chunk from the index, and avoid maintaining the submission list individually.