Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Better XML Sitemaps (WordPress plugin): set cache folder and exclude pages
<?php
defined( 'ABSPATH' ) or die();
$ll_sitemap = new ll_sitemap;
class ll_sitemap {
function __construct() {
add_filter( 'bwp_gxs_cache_dir', array( $this, 'cache_dir' ) );
add_filter( 'bwp_gxs_excluded_posts', array( $this, 'exclude_pages' ), 10, 2 );
}
function cache_dir() {
return WP_CONTENT_DIR . '/sitemaps';
}
function exclude_pages( $excluded, $post_type ) {
switch ( $post_type ) {
case 'page' :
return array( 7, 8, 42, 94, 95, 122, 123, 145 );
break;
}
return array();
}
} // class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment