WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Yoast WordPress SEO Sitemap - exclude pages by ID# (3 posts)

  1. Haz
    Member
    Posted 7 months ago #

    Quick question about your sitemap. I want to include some pages, but exclude other pages...is there any way to do that? Can we exclude pages by ID number?

    http://wordpress.org/plugins/wordpress-seo/

  2. Sith Lord Goz
    Member
    Posted 7 months ago #

    @tvguy2000

    I searched the source files - it seems there is a filter available to exclude pages by ID - it's just not exposed through the UI.

    wpseo_html_sitemap_page_exclude()

    In your functions.php, if you hook this filter with a function that returns an array of page IDs, it should exclude them from the sitemap.

    However, I don't think this will work with Posts (vs. Pages) because that's a separate query and doesn't have an equivalent filter. Hopefully Yoast will just add a simple "exclude by ID" field to this excellent plugin :)

    Hope that helps!

  3. Sith Lord Goz
    Member
    Posted 7 months ago #

    Actually scratch that - that filter is only for the HTML sitemap that you can include in a page via a shortcode, it doesn't affect the XML SEO sitemap :(

    Let's hope the author adds this to a future version.

Reply

You must log in to post.

About this Plugin

About this Topic