WordPress.org

Support

Support » Plugins and Hacks » Yoast WordPress SEO Sitemap – exclude pages by ID#

Yoast WordPress SEO Sitemap – exclude pages by ID#

Viewing 5 replies - 1 through 5 (of 5 total)
  • @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!

    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.

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

    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!

    thanks for pointing this out nicoblog.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Yoast WordPress SEO Sitemap – exclude pages by ID#’ is closed to new replies.