WordPress.org

Support

Support » Plugins and Hacks » XML Sitemap & Google News feeds » [Plugin: XML & Google News Sitemap Feeds] How to exclude pages from sitemap.xml

[Plugin: XML & Google News Sitemap Feeds] How to exclude pages from sitemap.xml

Viewing 1 replies (of 1 total)
  • i figured out that there is a way in feed-sitemap.php in line 50.

    in the array

    // the main query
    query_posts( array(
    	'post_type' => 'any',
    //	'post_status' => 'publish',
    //	'caller_get_posts' => 1,
    //	'nopaging' => true,
    	'posts_per_page' => -1 )
    );

    add

    'post__not_in' => array(1346,1303),

    Result:

    // the main query
    query_posts( array(
    	'post_type' => 'any',
    	'post__not_in' => array(1346,1303), // exclude pages
    //	'post_status' => 'publish',
    //	'caller_get_posts' => 1,
    //	'nopaging' => true,
    	'posts_per_page' => -1 )
    );

    dont forget to clean your cache after editing the file.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: XML & Google News Sitemap Feeds] How to exclude pages from sitemap.xml’ is closed to new replies.
Skip to toolbar