You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running XML Sitemap Generator on my blog which is disabling the new core feature from WordPress 5.5 with a filter: add_filter( 'wp_sitemaps_enabled', '__return_false' );
Although there is no sitemap under /wp-sitemaps.xml on my site I have 114 requests tracked in Statify for this address (which results in a 404).
I think we should hide those requests, but unfortunately there is no conditional tag like is_sitemap() but there is a comment with an answer on the official post:
Is there a template function like is_sitemap() or doing_sitemap(). I ask as I have a other filters I running that should not run inside the sitemap.
There currently isn’t, so checking get_query_var( ‘sitemap’ ) is probably the easiest way to do that
Confirmed. at least in default mode (no JS).
Unsuprisingly we do not detect the Sitemap call. Even if disabled and a 404 is returned, is_404() results in false for this call. With JS enabled, the 404 is fine.
We should add defined treatment for sitemap calls anyway, i.e. always skip tracking (because it is never possible with JS enabled).
Tested in WP 5.5.1
Core Sitemaps enabled
Statify in Default mode (no JS)
wp-sitemaps.xml delivers XML sitemap
Statify tracks sitemap visit
Statify in JavaScript mode
wp-sitemaps.xml delivers XML sitemap
no Statify call
Core Sitemaps disabled
Statify in Default mode (no JS)
wp-sitemaps.xml delivers 404
Statify tracks sitemap/404 visit
Statify in JavaScript mode
wp-sitemaps.xml delivers 404
no Statify call
Apparently out tracking hook in the template_redirect phase for non-JS is too early and the sitemap module has not yet been processed, so we don't know if there actually is a sitemap or not. The wp_footer hook for JS is skipped correctly, because is_404() returns true at this point.
I am running XML Sitemap Generator on my blog which is disabling the new core feature from WordPress 5.5 with a filter:
add_filter( 'wp_sitemaps_enabled', '__return_false' );
See: https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/
Although there is no sitemap under
/wp-sitemaps.xml
on my site I have 114 requests tracked in Statify for this address (which results in a 404).I think we should hide those requests, but unfortunately there is no conditional tag like
is_sitemap()
but there is a comment with an answer on the official post:See: https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/#comment-39484
The text was updated successfully, but these errors were encountered: