Sitemap Preloading is Using Wrong URLs
-
I recently switched my site over to use the AIOSEO plugin’s internal Sitemap generator. And now it’s working correctly, Google is reading it fine, no errors. However, I’m getting numerous 404 errors that are coming from the W3TC system trying to do the Precache using the sitemap.xml pages.
This is the EXACT same error someone else posted about last year right here: https://ww.wp.xz.cn/support/topic/page-cache-pre-load-wrong-urls-fetched/
Same combo of plugins. Same exact issue. The 404 errors are saying that W3TC is trying to read the <CDATA> part of the URLs as that’s how they’re listed within the new sitemap.xml files. We have figured out this comes exactly from the “
parse_sitemap” function in the plugin. This line using preg match ends up not removing the “CDATA” part of the sitemap and should be patched to better work around this (since many sitemaps also use the CDATA encoding):if ( preg_match( '~<loc>(.*?)</loc>~is', $sitemap_match, $loc_matches ) ) {Is this something that can be patched and fixed in an upcoming version? It seems to only apply to the W3TC system that is trying to use the sitemap for pre-loading the cache. And since it’s getting the URLs wrong because of that line, we have to manually fix and patch the W3TC plugin to get it to correctly read the sitemap as is right now. Any other way to fix this or get around it? I would prefer to keep my current Sitemap running with the extra CDATA encoding in it as it works fine and I don’t want to switch this. But I also want to get the AIOSEO sitemap and W3TC plugin to work correctly together without any other errors or problems. Thank you.
The topic ‘Sitemap Preloading is Using Wrong URLs’ is closed to new replies.