Created
March 24, 2021 12:58
-
-
Save lil5/a8563ca7468d5755998610c40cc6a420 to your computer and use it in GitHub Desktop.
Removes unwanted Wordpress sitemaps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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