WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Haz
    Member
    Posted 1 year 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 1 year 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 1 year 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.

  4. nicoblog
    Member
    Posted 4 months ago #

    How did yoast missed this?
    I don't want noindex pages on my sitemap!

  5. nicoblog
    Member
    Posted 4 months ago #

    HE DIDN'T MISS IT.

    Go to edit post/page on advanced tab if you set the post(page to no index it will be automatically excluded.

    However ig you want to index it but just remove it from the sitemap you can also do that by selecting never include on sitemap option.

    SOLVED!

  6. jnz31
    Member
    Posted 3 months ago #

    thanks for pointing this out nicoblog.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic