-
Notifications
You must be signed in to change notification settings - Fork 76
wp-sitemap.xml displays duplicate recurring events #547
Copy link
Copy link
Open
Description
As of WP 5.5, WP generates a wp-sitemap.xml file for all available, public post types: https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/.
In the generated sitemap for EO's event post type, duplicate recurring events are being displayed.
To fix this, filter the WP sitemap post query args to set EO's 'group_events_by' query parameter to 'series':
/**
* Do not show all duplicate recurring events in event sitemap.
*/
add_filter( 'wp_sitemaps_posts_query_args', function( $retval, $post_type ) {
if ( 'event' === $post_type ) {
$retval['group_events_by'] = 'series';
}
return $retval;
}, 10, 2 );
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels