Hi @ownerstorefly thanks for the review π
Since then, the plugin has not been updated so if something changed, it must be coming from a conflict with either the latest WP version or another plugin. I’ll quickly run a test on WP 6.1 to see if I can reproduce the errors.
In the meantime, a quick question: are you using a cache plugin? I see in the response headers wpo-cache-status: cached (is that WP Optimize?) for the sitemap which might explain lingering errors after changing plugin settings…
Just tested on WP 6.1.1 and found no issues. Can you tell me more about your setup?
ALSO, speaking of the above, why on earth is this plugin picking up my top level domain?
I don’t understand the question. The plugin does not handle or modify the domain in any way… What do you see happening which should not happen?
About the empty lastmod tags: can you tell me how/where you got these? In your example code I see it happen on the home URL. Did it occur anywhere else?
The empty lastmods are maybe related to the fact that you have no posts on your site. Maybe you had before but deleted all? I’ve put a fix in the upcoming release.
if lastmod is enabled (which mine ISNβT anymore) it produces dates that are invalid.
Where do you see these dates? With Lastmod disabled, there should be no dates in the sitemap at all…
First off, I really really appreciate you looking into this… I think regarding the actual dates generated, they are fine. The issue seems to be the generation of items that should be excluded due to insufficient date, like the TLD.
The two errors that google was complaining about (initially) was:
https://storefly.com/blog/
https://storefly.com/
Both of these had no leading “<lastmod>”, no date, but had a closing “<lastmod/>”, which freaks out google and other sitemap checkers.
Since I don’t use a blog, I fixed the “/blog” by “hiding” this page, but the one with the TLD persists, with no way of excluding it.
So maybe the fix should be something like: If there is no valid date, exclude the whole line all together?
Thanks
Mike
Hi @ownerstorefly, indeed that is the fix that is in version 0.5 that was just released…
I’ve also tested with WP Optimize and the sitemaps are cached by that plugin so when you use an external validation service, please be aware that it will probably get a cached version, unless you either manually clear the cache, or make a page/post modification (triggering a cache purge) beforehand.
Let me know how version 0.5 works out π
Thanks Rolf. It appears that the empty date <lastmod> date issue is fixed. However, now there is a new issue.
On the main wp-sitemap.xml file, only the first wp-sitemap-posts-product-1.xml has a lastmod date, all others have no date.
Each product post has 2000 entries, but since I have about 25,000 total products, it has to span into multiple files. Perhaps the <lastmod> date should be the latest out of the 2000 entries?
This is what I’m getting.
</sitemap><loc>https://storefly.com/wp-sitemap-posts-page-1.xml</loc><lastmod>2022-11-21T10:42:24-07:00</lastmod></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-1.xml</loc><lastmod>2022-11-28T07:30:41-07:00</lastmod></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-2.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-3.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-4.xml</loc></sitemap>
</sitemap><loc>https://
storefly.com/wp-sitemap-posts-product-5.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-6.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-7.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-8.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-9.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-10.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-11.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-12.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-posts-product-13.xml</loc></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-taxonomies-pwb-brand-1.xml</loc><lastmod>2022-11-28T07:30:41-07:00</lastmod></sitemap>
</sitemap><loc>https://storefly.com/wp-sitemap-taxonomies-product_cat-1.xml</loc><lastmod>2022-11-28T07:30:41-07:00</lastmod></sitemap>
Hi, no the Lastmod for subsequent sitemaps (after the first one) has not been implemented yet. I’m working on a solution but it may take a while…
Suggestion: If you are generating the main sitemap index first, reverse it. Generate the others first and put it’s information in an array, update as you go, then perform a final write of the main sitemap.xml last.
Its a logical thought but the sitemaps are not “generated” in a static sense. They are dynamic, generated “on the fly” on each visit.
But you are right, some kind of pre-fetch caching of the lastmod data is going to be needed. Otherwise generating the index (on the fly) will get too slow on large sites.