WordPress.org

Ready to get started?Download WordPress

Forums

Google XML Sitemaps
[resolved] BWP GXS: how to exclude a page from the sitemap (6 posts)

  1. Rudolph Smits
    Member
    Posted 2 months ago #

    I want to exclude a certain page from being put into the sitemap. Browsing this forum confuses me.

    It should be done by excluding the page number(s). But where to do so?

    I do also find a solution to add this function:

    add_filter('bwp_gxs_post_where', 'sitemap_where', 10, 2);
    function sitemap_where( $query, $post_type ) {
    switch ( $post_type ) {
    case 'page' :
    return ' AND wposts.ID NOT IN (128,187,5339) ';
    break;
    }
    return '';
    }
    Is this the way to solve it? But in which file should I add it to?

    Thanks for your advise!

    Regards
    Rudolph Smits, Netherlands

    Installed version: BWP GXS 1.2.2.

    https://wordpress.org/plugins/google-sitemap-generator/

  2. sismaxis
    Member
    Posted 2 months ago #

    If you are using this plugin, in WP-admin just go in Settings > XML Sitemap Generator > Excluded Items section and list ID's for pages that you want to exclude from sitemap.

  3. Rudolph Smits
    Member
    Posted 2 months ago #

    @sismaxis

    Thanks for answering so quickly. But there is the reason for my confusion: there is NOT such a section as Excluded Items.

    I guess that with v 1.2.2. I have the latest version.

    Should it help when I delete the plugin and there-after re-install it? And doing so, do I lose then all my settings?

  4. Rudolph Smits
    Member
    Posted 2 months ago #

    Update: today upgraded to v. 1.2.3.

    No change in behavior or additional options.

  5. arnee
    Member
    Plugin Author

    Posted 2 months ago #

    You have posted in the wrong forum. This forum is for this plugin, which includes the exclude option:

    http://wordpress.org/plugins/google-sitemap-generator/

  6. Rudolph Smits
    Member
    Posted 2 months ago #

    @Arnee

    Thanks, I can see what I did wrong.
    I will try again but this time on the right forum.

    Then the issue here can be closed.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.