Back to Community

Fixing Last Modified Date Issues in XML Sitemap Generator for Google

10 threads Sep 16, 2025 PluginXml sitemap generator for google

Content

Many users of the XML Sitemap Generator for Google plugin encounter issues where the Last Modified (GMT) date in their sitemap does not update correctly. This is a common point of confusion, particularly for taxonomy pages like WooCommerce product categories, tags, or custom taxonomies.

What is the Problem?

Users report several related symptoms:

  • The last modified date for category or taxonomy pages does not update when a post within that category is updated.
  • The field appears empty for some taxonomy entries.
  • The date shown is the post's creation date, not its most recent modification date.
  • Time zone discrepancies, where the GMT time does not match the expected local time.

Why Does This Happen?

This behavior is not necessarily a bug but is rooted in how WordPress and the plugin handle data.

  1. WordPress Core Limitation: Unlike posts and pages, WordPress taxonomies (like categories and tags) and custom taxonomies do not have a built-in 'last modified' date field in the database. The plugin must calculate this date.
  2. Plugin Calculation Method: To generate a date for these taxonomies, the XML Sitemap Generator for Google plugin typically uses the date from the most recent post published within that taxonomy. However, some user analysis suggests that in certain cases, it may use the date of the first post instead of the most recent modified post.
  3. Time Zone Configuration: The plugin displays dates in GMT (Greenwich Mean Time)/UTC. If your server's time zone is not set correctly, this can create an apparent discrepancy between the time you see in your WordPress admin and the time listed in the sitemap.

Common Solutions and Workarounds

1. Verify Your Server's Time Zone

Before investigating more complex issues, rule out a simple time zone mismatch. The sitemap uses GMT, but your server must be configured correctly to ensure the calculation from your local time to GMT is accurate.

  • Contact your web hosting provider to confirm your server's time zone settings are correct.
  • You can also use a WordPress-specific function in a test file to output your server's current time and time zone for verification.

2. Understand Expected Behavior for Taxonomies

It is important to note that for taxonomy sitemaps (e.g., sitemap-tax-product_cat.xml), the 'last modified' date for a specific category is often the publication or modification date of the most recent post within that category. Updating the category description itself may not always trigger an update to this date, depending on the plugin's implementation. The top-level sitemap index file (e.g., sitemap-tax-product_cat.xml) is more likely to update as it represents the entire sitemap, not individual URLs.

3. Code Modification (Advanced Users)

Warning: This solution is for advanced users only. Always create a full backup of your site and use a child theme before modifying code. Some community members have successfully used code snippets to change how the plugin handles dates.

The goal of such a modification is to force the plugin to use the post_modified_gmt field instead of the post_date_gmt field when calculating the last modified date for taxonomy terms. This ensures the sitemap reflects when a post was last updated, not just when it was first published.

Important Note: The exact code required for this modification can change with each plugin update. The code shared in older forum threads (like the one mentioned in the sample threads) may be outdated and incompatible with the current version of the plugin. Relying on such code without understanding it could break your site.

4. Forcing a Today's Date (Not Recommended)

Some users ask about forcing the sitemap to always show today's date. This is generally not recommended for SEO purposes, as search engines like Google use the 'last modified' date to understand how fresh your content is. Providing an inaccurate date can hinder, not help, your indexing.

Conclusion

In most cases, the 'last modified' date behavior for taxonomies is a design decision by the XML Sitemap Generator for Google team based on WordPress's technical constraints. While a code modification exists to change the date source, it requires technical skill to implement safely.

For most users, the best course of action is to understand that the date reflects the latest activity within a taxonomy term rather than an update to the term itself. If you suspect a genuine bug, such as the date being completely empty or clearly incorrect (e.g., always using the oldest post's date), reviewing the plugin's change logs for recent updates is a good practice, as the development team may address these issues in new releases.