Written by James McDonald

February 17, 2022

I use WordPress for customer websites with the Divi theme and layouts however WordPress is fundamentally a blogging platform so its sitemap.xml contains links to categories and users and you might not want to have those publicised and indexed by Google

The following snippet tells WordPress to skip a couple of the things it normally includes in the sitemap. In this case categories (taxonomies) and the users

Add this to your themes functions.php

add_filter( 'wp_sitemaps_add_provider', function ($provider, $name) {
  return ( in_array( $name, [ 'users', 'taxonomies' ])) ? false : $provider;
}, 10, 2);

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Meraki Open Source Licenses

Until today I assumed that Meraki was built in-house with only closed source software. But having a look at the...

VEEAM FAILS

If you have Veeam backup failing with the Updating BCD failed with Cannot update SafeBoot flag and SentinelOne is...