Every day, rebuild the site, and change the lastmod attribute of all articles to the current date. This makes it appear to search engines that the entire site is updated daily. In reality, only two articles are published, and the content of the older articles remains unchanged. The lastmod attribute should describe meaningful modifications to the page content, rather than simply indicating that the deployment pipeline has just run.
This text uses the example of an article website. A sitemap is a file that helps users discover URLs, but it is not a guarantee of inclusion or a mechanism for hiding pages. Pages that are not listed in the sitemap can still be found through links, and private content must have true isolation.
Generate a sitemap based on page identity, not directory files
Assume that the source directory contains 100 articles, but only 10 are actually publicly available. Scanning all Markdown files and then guessing whether they can be indexed can easily lead to discrepancies compared to the article routing and filtering process. The sitemap should only consume records of pages that have been confirmed as publicly available, including complete URL addresses, content types, and indexing policies. Private drafts should not be included in this list, and the sitemap plugin should not re-read them. The list hiding does not equal product isolation.
The page list also includes static pages and topic indexes, which are determined by actual content value. Redirects, missing pages, and temporary previews are not considered valid content addresses. A path can return 200, but it might simply be a return to the platform’s homepage, so acceptance checks not only the status but also the correct page identity. Do not directly treat all paths obtained from scanning files with the “dist” extension as public URLs.
The primary domain source and canonical reuse are configured with controlled settings, and the language path and trailing slash rules remain consistent. If the deployment environment treats a temporary entry as a site, it can lead to incorrect identity propagation. Production builds require a correct absolute base URL, and preview builds should adhere to clear noindex and non-public policies. The environment should not determine the permanent content address.
<url>
<loc>https://example.dev/writing/cache-key/</loc>
<lastmod>2026-10-12</lastmod>
</url>
The loc attribute should be the standard address under the main domain, and should not be mixed with preview domain names, temporary worker subdomains, or redirection entries. Whether article details, categories, and pagination are included depends on the actual indexing policy. The presence of a route does not necessarily mean that it is suitable for indexing.
The draft and future articles should be filtered from a unified, publicly accessible collection. If the sitemap plugin automatically traverses all built routes, it should be confirmed that it does not include preview or special pages. Do not rely on “homepage not displayed” to prove sitemap security.
Defining “Meaningful Modification” for Maintainability
The main arguments regarding changes, code fixes, and important data updates typically affect the content. Recompressing resources or updating build identifiers usually does not affect the semantic meaning of the article. Whether the title and abstract constitute a meaningful change can be determined according to editorial rules. The rules do not need to be as fine-grained as individual punctuation marks, but they cannot directly equate the last modification time of a file with manual review. Explicitly updated timestamps, combined with editorial submission notes, are often more reliable than automatic guesses.
Assuming a dangerous command has been corrected, and this represents a significant content fix, the article description and update time should be updated. While uniform formatting of whitespace may not require updating the entire lastmod timestamp, Git history can provide potential evidence, but a shallow clone may lack records, renaming can change the path, and merging commits do not directly express content timestamps. If automatic derivation is used, these scenarios must be defined and tested, and the latest date from the git log should not be used mechanically.
If reliable data is unavailable, omit the field and use a default value for the build date. A sitemap is a signal; false precision is worse than admitting missing data. Dates can be specified using valid date formats or date/time formats with time zones, and should be consistent with the agreement and project specifications. Invalid future dates, leap days, and formatting errors should be rejected during the build process. Future drafts are not publicly available and should not be added to the sitemap simply because they contain a date.
The article should explicitly maintain updatedAt, and update it whenever significant content changes occur. When initially publishing, use publishedAt. If deriving from Git history, consider shallow cloning, renaming files, and bulk formatting. Do not mechanically treat the most recent file changes as semantic updates.
The mtime (modification time) of the operating system is unreliable because CI checkout, file copying, and decompression can change it. When the actual modification time is not available, omitting the lastmod value is often preferable to fabricating one. Changes to the title, content, and important structural elements can affect the update date, while changes to log files or build identifiers do not need to be considered.
Some teams attempted to update all “lastmod” values daily to attract crawlers, but this resulted in dates losing their credibility. Maps that provide genuine, up-to-date information are more valuable in the long run, and cannot be used to artificially inflate inclusion rates. New articles can be discovered through internal links, RSS feeds, and the map itself. Older articles do not need to be artificially altered to reflect changes. Search systems combine indexing results, and the engineering team is responsible for ensuring accurate signals and accessible content.
Page-level modifications also need to distinguish between global templates. When a new link is added to the navigation, all article HTMLs are affected, but this does not automatically require all articles to update their lastmod values. Field changes should focus on meaningful content changes, and the definitions should comply with search engine guidelines and project editing rules. If significant template changes affect page understanding, such as adding important legal disclaimers or altering the content structure, it is appropriate to intentionally update related records and provide the reason. “Byte changes” should not be directly equated with “content updates.”
The author’s review can provide update information, and the machine check confirms that the corresponding valid date is within the allowed range. Update information does not necessarily need to be fully disclosed, but it can support internal tracking. When the article is first published, do not fill in a date earlier than the actual publication date to falsely claim authorship. The draft should not be added to the map before it is publicly released. Date credibility requires a process; the schema can only check the format, but it cannot determine whether the author has actually made changes.
The map partitioning should use stable rules. This involves dividing the content by type or by a limited number of categories, ensuring that URLs are not duplicated and that index files correctly reference the content. The update time of the index should be different from the lastmod date of the specific page and should not be randomly generated from the current system time. Large sites may require complex partitioning, but individual blogs should remain simple and complete initially, expanding only when the protocol limits are reached.
If map generation fails, retain the complete previous deployment, which is safer than uploading a partial XML file. If you must update the map independently, ensure that the page is publicly available first, followed by the map declaration. Verify the deletion and migration steps in a clear sequence. A successful deployment of the control map is not evidence that the XML is parsable; online requests must also check the content type and body. Template errors can cause the feed or map to return to the HTML homepage, making the status code unidentifiable.
Finally, compare the draft sentinel with the public path in each release. Check that the un-scheduled title, slug, and content are not present in the output. The map is simply an export, not the only source of leakage. The search index, client data, and logs also need to be isolated. The trusted lastmod and strict public collection complement each other: one is responsible for accurate signal updates, while the other is responsible for the boundary of un-published data.
Index Signals Must Be Supported by Corresponding Responses
The map lists URLs where the page’s canonical tag points to another URL, and where the response redirects permanently to a third URL. This can create confusing signals. The checker can compare these three and flag the conflicts, and justifications are required for any exceptions. The sitemap does not determine which pages are indexed by search engines, nor does it guarantee that listed pages will be included. The goal is to accurately describe the content and provide accessible entry points, without promising specific search ranking results.
The “robots” directive and the “noindex” meta tag have different functions. While the “robots” directive prevents search engine crawlers from accessing a page, it does not necessarily prevent them from seeing the “noindex” meta tag. However, both mechanisms do not prevent ordinary browsers from accessing the page. Private content can be excluded from public indexing or accessed using real access controls, and cannot be circumvented using map-based exclusion and crawling rules to impersonate confidentiality. Indexing policies and data access rights should be maintained at different levels.
The indexing and pagination should be determined based on the actual content, not all pages should be canonicalized to the homepage, and no infinite URLs should be generated for arbitrary filtering. When the number of pages increases, the map capacity and scraping budget should be considered, but reducing the number of map items does not mean deleting routes. First, define the page categories that are allowed to be indexed, and then generate and test, to avoid exposing pages that are of no value or are not publicly available in order to create a “complete map.”
Multilingual Pages Have Separate Identities
Different language pages can be related using hreflang, but each URL must be real and have the correct language content. Do not list incomplete language variations, and do not assume that pages sharing the same slug share the same lastmod attribute.
The language root page and the selection of “x-default” must align with the initial negotiation strategy. The sitemap association only provides signals and cannot replace the page’s lang, canonical, and accessible language entry. Maintaining a structured page mapping is more reliable than concatenating URLs in multiple templates.
Updated Chinese text; English translation has not yet been synchronized. The lastmod attribute for both pages should not be refreshed together. The language association, description, and version correspondence should be updated, and the update time should reflect the specific changes on the page. When no translation is present, a placeholder URL should not be generated; when the translation becomes invalid, the editor rules should determine whether it should remain public or marked, and it should not be disguised using a sitemap. Stable content identification helps with association, and it should not automatically infer based on similarity of titles or slugs.
The hreflang relationship requires correct language codes, accurate URLs, and mutual consistency. Maps can provide language signals, but HTML still maintains the lang, canonical, and switchable entry points. The x-default attribute should align with the entry points to specify which default page should be used, and it should not generate new language pages for unsupported tags. Browser language preferences are a limited routing selection, not a basis for new content identity.
Differentiating Content Time and Build Time Through Three Edits
The first fix involved correcting an erroneous SQL query, which required updating the actual modification time and providing a clear explanation of the changes. The second involved recompressing the cover image, where the byte size changed but the main content remained the same. The third involved updating the navigation, where the HTML of the page changed, but not necessarily all articles were modified. The editing rules independently determined whether all Git changes should be automatically reflected in the “lastmod” field. The “lastmod” field represents the content signal, while the summary generation represents the output signal. These two fields address different issues.
Test the fixed set of public records, generating maps at different build times. The “lastmod” field for each record should remain consistent. Then, modify a single approved record and its update time, ensuring that only that specific record is updated. Next, change the layout and verify that it adheres to the project’s explicit rules for template modifications. The test values should come from factual information and policies, not automatically from the file’s “mtime”. “checkout” and “copy” operations cannot create genuine content updates.
If there are no reliable historical timestamps, the lastmod field can be omitted, while maintaining a stable URL and public status. When importing in bulk, do not fill in the current date to falsely represent all articles as recently updated, nor fill in arbitrary early dates to create a false sense of authority. The author should then provide supporting evidence. Date format validation can detect invalid calendar values, but cannot determine whether the author actually modified the date; this requires a process and manual review.
Creating Precise Projections of Derived Maps from Open Path Lists
The content collection provides published articles, the routing plan specifies the final destination, and the indexing policy defines the page categories allowed to participate in the map. Combining these three elements generates records, rather than scanning and outputting a directory to infer that all pages are worth indexing. Topic indexing, pagination, and legal pages can have independent policies, and redirects or missing pages should not be disguised as content. For addresses that cannot be confirmed, it is better to review them first, rather than using a 200 status as the sole qualification.
The public list and map check must align on the same subset. For example, the full list includes the homepage and topic pages, and the number of maps does not need to equal the number of articles. By comparing the specific IDs and addresses within the article collection, you can identify the number of missing and incorrect articles. Use language, trailing slashes, and the main domain configuration as path contract inputs to avoid each exit maintaining its own string concatenation rules.
After generation, use an XML parser to read the data and verify the unique address, valid time, and protocol restrictions. When querying addresses containing “#”, proper escaping is required. Concatenating raw strings can easily corrupt the XML. The encoding of non-ASCII paths must correspond to the actual reachable address. The parser should not assume that a page exists simply because it accepts a string. The correctness of the generated output and the correctness of the online routing are verified separately.
Translation updates are page-level facts.
The Chinese version includes a case study on transaction rollback. The English version remains unchanged. The “lastmod” field in English should not automatically update with the Chinese version. Ensure stable content ID association with language versions, and specifically link the update time to the actual changes on the page. This establishes an optional language relationship, but does not guarantee synchronization. The editing system can record the corresponding source version for the translated text, and public information should be expressed according to its actual status, creating the illusion of a complete translation without relying on a unified date.
If there is no corresponding translation, no hreflang placeholder URL will be generated. When a translated version is removed from the public collection, the associated links on all pages and in the map will be updated synchronously. The old paths will be retained or removed according to the migration policy. The relationships between the switch, HTML lang, canonical, and the map will come from the same approved mapping, and each output will still check for valid results. The root entry will not change the explicit language page identity, and unsupported browser preferences will not create new pages.
Significant Differences Require Explanation, Not Automatic Acceptance
After publishing two entries, the map suddenly deleted 100 addresses. This could be due to changes in loading rules, default values for public fields, or changes in routing prefixes. The change report separates new additions, deletions, migrations, and date refreshes, with sources provided for each. Thresholds help identify anomalies, but large-scale migrations can also be legitimate and require manual confirmation rather than being automatically rejected. We cannot simply re-add old addresses solely to pass a quantity check, without verifying that the corresponding content still exists.
Domain migration also involves more than just replacing “loc”. It requires verifying that old entry redirects, new page canonical URLs, the main domain of the map, and absolute image addresses are consistent. The language and deep paths should also remain accessible. Old map data may still be cached, and while the update window and precise clearing capabilities are provided, this does not guarantee that all search engines will immediately see the new version. The project provides accurate and controllable signals, but does not guarantee ranking or indexing times.
The acceptance of a fragmented map also requires comparing the union of all sub-files with the approved list. A single XML fragment does not prove that another fragment is complete; duplicate entries for the same address across fragments should also be identified. The addresses of sub-files in the index should use the approved primary domain, and the files must exist and conform to the size restrictions. The fragmented update time indicates that the file content has changed, and it does not mechanically inherit the latest page date or the current build time.
When a small site doesn’t meet the protocol’s size limitations, a simpler map is easier to maintain. Splitting can be done to accommodate different service types or scales, without having to introduce multiple indexing layers upfront for a complete architecture. Regardless of the form, genuine zero-item and loading failure cases are classified separately; the generator requests an explanation when it sees a public collection suddenly become empty, and does not treat empty files with XML shells as successful publications.
XML Parsing, but also Check Element Namespaces
The generator has modified the template, but the resulting XML file is still valid, but the namespace declaration for the <urlset> element is missing or incorrect. Successful XML parsing only indicates that the structure is well-formed, not that it conforms to the sitemap vocabulary. Acceptance criteria include verifying the complete name of the root element and the scope of the loc and lastmod attributes. Furthermore, extended fields must be used according to their declared types, and all nodes should not be treated as protocol records simply because they appear to be similar based on their tags.
The fixed sample includes a normal map, an incorrectly named namespace, and entries missing necessary addresses, and the parsing and protocol validation results are checked against each. The XML tree displayed in the browser does not necessarily mean that the external consumer has accepted it. The test report clearly indicates which level passed, and retains these negative examples when upgrading the plugin; do not use the expanded matching rule to accept any elements with the same name, so that a real template error becomes “compatible.”
Private content should not be hidden using a sitemap
Sentinel testing involves placing private titles, slugs, and content markers separately into synthetic records. This ensures that no mapping, HTML, search index, or client-side data contains these private elements. The omission of maps can only reduce one entry point, but it does not protect the already generated detail pages. “robots” and “noindex” are not access controls; they are not intended to prevent access to sensitive information. Sensitive data should never be included in public builds or protected by legitimate authorization.
The final acceptance record should include the scope, date, source, online accessibility, and consistency with the index signal. Each lastmod entry should explain the reason for the change, and each loc entry should correspond to approved resources. This is more valuable than filling out attributes for all entries. Fewer fields, but more reliable data, make it easier for maintainers and external systems to understand the site’s real updates.
Migration and Deletion Require Complete Acceptance
Once an old URL has been permanently redirected, it should be removed from the main sitemap and the redirect should be retained. Content that has been deleted should no longer be included, as this would cause crawlers to repeatedly request non-existent resources. For large sites, it is also necessary to adhere to file item and size limits, and to split and use index files if necessary.
The robots.txt file can declare sitemap addresses, but it is not a permission system. Blocking crawling does not guarantee that URLs will not be indexed, and it cannot prevent regular visitors from accessing them. If a page requires noindex, crawlers typically need to be able to see the corresponding instruction. It is not appropriate to arbitrarily combine these two mechanisms into contradictory strategies.
During validation, parse the XML, check for URL uniqueness, consistent main domain, expected status for each target, and a valid and trustworthy lastmod value. Implement a draft sentinel and search for the output to ensure that no unpublished titles or slugs appear. The quality of the sitemap depends on whether it accurately describes the publicly available content, rather than simply having the most fields.
The fragmented release still presents the combination of “new index, old sub-files.” The primary index points to two primary maps, and the secondary map overwrites one of them before updating the other. A crawler might then read a subset that doesn’t belong to either complete version. If the platform doesn’t support switching between complete versions, you can use version addresses for the sub-maps, first providing and validating all secondary files, and then updating the stable index entry. Whether this mechanism is actually needed depends on the platform; it prevents small sites from being burdened by the illusion of increased scale.
The retention period for the original version files should cover any older indexes that may still be in use. Updating a stable index does not mean that all readers have obtained the second version. Immediately deleting the original version will cause missing references to the older index. The version list records the relationship between the index and the sub-file. Cleanup should be based on supported references rather than just looking at the current directory. After the old entry stops being distributed, the historical processing by external crawlers is still determined by the consumer, and we cannot guarantee that all crawlers will switch immediately.
Preserve both versions of the index (A and B) for verification. During the period when version B is active, read all its sub-files and compare their union with the corresponding approved page list. Then, simulate a scenario where a sub-file upload fails, confirming that the stable entry still points to the complete version A, rather than a partial version B. This test verifies cross-file delivery; each XML file is individually valid, and the number of URLs is reasonable, but this is still insufficient to prove that the index represents a consistent public directory.
References: Google Sitemap, Sitemaps Protocol.