Remove Past Events from XML Sitemap
-
I have Yoast SEO installed as well as The Events Calendar. I’d like to use the filter to remove posts from the XML sitemap, whenever those posts are events that occurred in the past. So far, I’ve been able to find some filters and functions that should help with this. I’ve put the following into the funcitons.php file, but it doesn’t seem to work.
//remove past events from yoast sitemap add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function () { tribe_get_events(array('posts_per_page'=>-1, 'eventDisplay'=>'past') ); } );
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Remove Past Events from XML Sitemap’ is closed to new replies.