Skip to content

Instantly share code, notes, and snippets.

@uprise10
Created November 16, 2017 14:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uprise10/82899d25d57bc0b47b5cd9714eb02c34 to your computer and use it in GitHub Desktop.
Save uprise10/82899d25d57bc0b47b5cd9714eb02c34 to your computer and use it in GitHub Desktop.
Exclude author XML sitemap from Yoast SEO
<?php
add_filter( 'wpseo_sitemap_exclude_author', function () {
return [];
});
@iamRahul1973
Copy link

adding this results in the sitemap_index not accessible. It results in a 404 error... ;-( :-(

@uprise10
Copy link
Author

That's quite strange, since this filter shouldn't have any effect on the sitemap index itself, but only on the author items.

Is the 404 gone when you remove this piece of code?

I've tested this on a clean install, and that just works, so maybe another plugin or code from the theme is interfering here?

@iamRahul1973
Copy link

Yeah, the 404 is gone when i removed this code. May be an issue with a theme or plug-in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment