Created
July 5, 2019 21:49
-
-
Save joshfeck/e3f536564257d0a3d210ae685dfca3ca to your computer and use it in GitHub Desktop.
Yoast SEO XML sitemap: remove the single-event archive URL from the sitemap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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