WordPress.org

Ready to get started?Download WordPress

Forums

Better WordPress Google XML Sitemaps (with sitemapindex, multi-site and Google News sitemap support)
[resolved] [Plugin: Better WordPress Google XML Sitemaps] How to exclude a post type (4 posts)

  1. Lumpysimon
    Member
    Posted 3 years ago #

    Hi

    Great plugin, works perfectly and seems to have increased the number of items on my site indexed by Google.

    Just one question: is there an easy way I can exclude a particular post type, maybe with a filter or something?

    Many thanks
    Simon

    http://wordpress.org/extend/plugins/bwp-google-xml-sitemaps/

  2. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Glad that it works well for you! To know how to exclude a post type, please read this: http://betterwp.net/wordpress-plugins/google-xml-sitemaps/#basic_api.

    If you have a post type named 'test', for example, use this in the filter function: $bwp_gxs->remove_module('post', 'test');

    Hope that helps :), and thanks for using the plugin!

  3. Lumpysimon
    Member
    Posted 3 years ago #

    Great thanks - and presumably if I want to exclude posts (but allow other custom post types) I would use:

    $bwp_gxs->remove_module( 'post', 'post' );

    It seems to have worked but thought it best to make sure.

    Thanks
    Simon

  4. Khang Minh
    Member
    Plugin Author

    Posted 3 years ago #

    Yes that's correct :).

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic