wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Wrong last modified date time in sitemap index

Open benvaassen opened this issue 7 years ago • 16 comments

What did you expect to happen?

That the last modified date in the sitemap would reflect the last modified date of the posts/pages in that specific sitemap (discussed with SEO team, also their expectation of the workings of the sitemap dates). No caching used.

What happened instead?

The dates are not always the same.

How can we reproduce this behavior?

  • Set the max entries per sitemap to something low, like 2-5
  • Check the last modified dates for the sitemap
  • Notice the inconsistencies with the last modified dates, like in the following images:

Sitemap: xml_sitemap

Post-sitemap8: xml_sitemap

Sitemap: xml_sitemap

Post-sitemap15: xml_sitemap

User example with 18.000 posts and sitemap set to max 500 entries:

Sitemap: xml_sitemap

Post-sitemap7: xml_sitemap

Technical info

  • WordPress version: 4.7.5
  • Yoast SEO version: 4.8

benvaassen avatar May 26 '17 10:05 benvaassen

Please inform the customer of conversation # 197055 when this conversation has been closed.

benvaassen avatar May 26 '17 10:05 benvaassen

Some further testing:

1.Edit a post within a category. In the example below, I edited the post on July 4th, 2017

7

2.The category sitemap (in this example the coupon-sitemap) changed to reflect the current last modified date of that updated post

8

3.The main sitemap did not. In fact, in some testing the coupon-sitemap changed while in others the store-sitemap changed

10

NOTES: -Was not able to reproduce issue on my staging site with either WordPress' native category taxonomy set-up OR with a custom taxonomy such as the one's that can be created with a custom post type plugin. -User has 1000 in the sitemap to be displayed -User is updated with Yoast (4.9) but on WordPress 4.7.5 -User reported Back in Feb 2017, " It was working correctly up until around 3 months back from now." At that time user was on WordPress 4.7.2. -User reports "This date issue DO NOT happen with normal pages on our site and they reflect correct date in the sitemap."

More Notes: Last moddate in sitemaps may be ignored by Google: https://www.seroundtable.com/google-sitemap-priority-field-a-bag-of-noise-23645.html

Pcosta88 avatar Jul 04 '17 16:07 Pcosta88

Please inform the customer of conversation # 180345 when this conversation has been closed.

Pcosta88 avatar Jul 04 '17 16:07 Pcosta88

Please inform the customer of conversation # 209099 when this conversation has been closed.

Pcosta88 avatar Jul 17 '17 21:07 Pcosta88

Please inform the customer of conversation # 415752 when this conversation has been closed.

mayada-ibrahim avatar Aug 15 '18 15:08 mayada-ibrahim

Taxonomy sitemap last mod date is missing in the sitemap on parent taxonomies that only have posts in it's child taxonomies.

Result is, in Google's new search console:

Index coverage: Indexed, not submitted in sitemap

Discovery:
Sitemaps: N/A

Is the above an issue?

  • If we manually add a post to the parent taxonomy, the sitemap now displays a lastmod date of the post as expected.
  • Outputting last mod date in a parent tax archive using get_the_modified_date( $d, $post ) with only posts in the child taxonomies, does seem to output the correct last mod date (of the latest post in any child taxonomy).
  • Seems we are struggling to be indexed quickly and not ranking so well on these parent taxonomies - (needs more investigation), whilst child taxonomies seem to be doing better.

The big issue for us is that posts are created via the API via a CRM. (jobPostings) and therefore it's not possible to add posts to the parent taxonomies as a quick fix.

Any help fixing this would be super appreciated!

Cheers, Ben

bcorke avatar Aug 18 '18 12:08 bcorke

I see the same issue, but on my setup (WordPress 4.9.8 multisite, PHP 7.2.10) the first sitemap mod date never changes from its really old 2014 date no matter what I do. Updating a post within the first sitemap seems to move the post to the second sitemap and update the mod date for the second sitemap only. yoast-sitemap-moddate-bug

bpang avatar Oct 05 '18 19:10 bpang

Issue is related to having multiple sitemaps.

1. Have multiple sitemaps for a content type like posts

Many Post sitemaps

1

Notice /daily-candy-feature/ Last Mod Time as it appears in the Post-sitemap1.xml Screen Shot 2019-07-01 at 1 39 15 PM

2. Update the post Screen Shot 2019-07-01 at 1 39 44 PM

3. See the most recent numerical sitemap gets the Last Mod updated but the one where the post was originally stayed the same

2

4. Visit post sitemaps and see the post was moved to the most recent one

Post-sitemap1.xml no longer has the post Screen Shot 2019-07-01 at 1 49 38 PM

Post-sitemap4 does Screen_Shot_2019-07-01_at_1_50_30_PM

Tech Specs WordPress: 5.2.2 Yoast: v11.6 (free or prem)

Pcosta88 avatar Jul 01 '19 17:07 Pcosta88

Please inform the customer of conversation # 519931 when this conversation has been closed.

Pcosta88 avatar Jul 01 '19 17:07 Pcosta88

I can confirm that this issue is still there.

Basically also using filter to change the numbers of max entries the problem persist. It is like that yoast cache those values and also on generating new sitemaps that existed before it used that date. This happens only on the multiple files for the same post type.

Mte90 avatar Oct 13 '22 10:10 Mte90

Having a similar issue On a taxonomy page a when a post type is sent to draft, the modified date doesn't update Because from what I believe is the way it works :

For the sitemap we try to fetch the last modified post date from a post within that taxonomy to let Google know there is a change on that page.

So because an older post is on there then it doesn't update the sitemap date so Google still has the old content in the description

So I have to update a post type that is in that taxonomy that is published so that it no longer has an old date

It needs to make sure that when a post is changed to draft then (or post_status changes) then it recognises that fact and updates accordingly

andytela avatar Nov 02 '22 10:11 andytela

Please inform the customer of conversation # 1037430 when this conversation has been closed.

amboutwe avatar Jul 14 '23 19:07 amboutwe

Please inform the customer of conversation # 1120544 when this conversation has been closed.

RitchelLauron avatar Apr 03 '24 04:04 RitchelLauron

Related issue: https://github.com/Yoast/wordpress-seo/issues/15801

josevarghese avatar Jun 19 '24 05:06 josevarghese

Please inform the customer of conversation # 1144640 when this conversation has been closed.

shabnam611 avatar Jun 19 '24 05:06 shabnam611

Please inform the customer of conversation # 1147078 when this conversation has been closed.

shabnam611 avatar Jun 22 '24 04:06 shabnam611