Created
March 11, 2021 14:40
-
-
Save wp-seopress/f742c0de84c65f3b8b4c5cae71175170 to your computer and use it in GitHub Desktop.
Remove archive links per post type in HTML 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
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