Skip to content

While XML sitemaps are soon coming to WordPress …

While XML sitemaps are soon coming to WordPress core, I’ve finally figured out how to exclude pages from Jetpack’s sitemaps. The $post argument for jetpack_sitemap_skip_post, you see, is not a WP_Post object but a database row, and its ID is a string and not an int. (I know it says so right there, on https://developer.jetpack.com/hooks/jetpack_sitemap_skip_post/, but still. Also, that link doesn’t show on https://developer.jetpack.com/module/sitemaps/. Or rather, it does, on page 2, hidden behind “Older posts.”)

sitemaps – Jetpack Developer Resources
developer.jetpack.com