Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wp-seopress/f742c0de84c65f3b8b4c5cae71175170 to your computer and use it in GitHub Desktop.
Save wp-seopress/f742c0de84c65f3b8b4c5cae71175170 to your computer and use it in GitHub Desktop.
Remove archive links per post type in HTML sitemap
add_filter('seopress_sitemaps_html_remove_archive', 'sp_sitemaps_html_remove_archive', 10, 2);
function sp_sitemaps_html_remove_archive($display, $cpt_key) {
if ($cpt_key === 'product') {//remove "product" archive page
return true;
}
//do nothing for other CPT
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment