Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Yoast SEO XML sitemap: remove the single-event archive URL from the sitemap
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_seo_xml_sitemap_no_event_type_single($url, $type, $term) {
if (! isset($term->taxonomy)) {
return $url;
}
if ($term->taxonomy == 'espresso_event_type') {
$url = '';
}
return $url;
}
add_filter(
'wpseo_sitemap_entry',
'ee_seo_xml_sitemap_no_event_type_single',
10,
3
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.