Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Exclude Pages from sitemap created by Yoast
// exclude My Account, Cart, and Checkout from sitemap created by Yoast SEO
// Woocommerce handles the no-index of these oages through robots.txt
add_filter( 'wpseo_exclude_from_sitemap_by_post_ids', function () {
return array( 311, 322 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment