Skip to content

Instantly share code, notes, and snippets.

@lil5
Created March 24, 2021 12:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lil5/a8563ca7468d5755998610c40cc6a420 to your computer and use it in GitHub Desktop.
Save lil5/a8563ca7468d5755998610c40cc6a420 to your computer and use it in GitHub Desktop.
Removes unwanted Wordpress sitemaps
<?php
/*
Plugin Name: LI Sitemap
Plugin URI: http://li.last.nl
Description: A very basic sitemap plugin
Version: 1.0
Author: Lucian I. Last
Author URI: https://li.last.nl
License: GPL2
*/
add_filter(
'wp_sitemaps_taxonomies',
function( $taxonomies ) {
unset( $taxonomies['product_shipping_class'] );
return $taxonomies;
}
);
add_filter(
'wp_sitemaps_add_provider',
function( $provider, $name ) {
if($name === 'users') {
return false;
}
return $provider;
},
10,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment