Cannot use sitemap filter (PHP)
-
Hi,
I am trying to filter the results generated on my page-sitemap.xml. I am aware I can use the option Posts to exclude under SEO > XML > Sitemaps > Excluded Posts. However, this option only excludes the noted items and not their children.
Based on the information provided here, I tried adding the code to my Functions.php file, but it does not get “called”.
During my testing, I removed all the code I created and left only return true;. If I am not mistaking, this should have left me with no items on the page-sitemap.xml “page”, but nothing changes….
function sitemap_exclude_taxonomy( $value, $taxonomy ) {
return true;
}add_filter( ‘wpseo_sitemap_exclude_taxonomy’, ‘sitemap_exclude_taxonomy’, 10, 2 );
At some point, I though this issue could be related to my WP setup; we are using a child theme. So, I edited the main theme’s Functions.php to add the same code and see if anything changes, but no luck.
Am I missing a step somewhere?
The topic ‘Cannot use sitemap filter (PHP)’ is closed to new replies.