Skip to content

Instantly share code, notes, and snippets.

@amboutwe
Last active January 3, 2025 20:30
Show Gist options
  • Save amboutwe/63da5a51b1853ba7cbfbe4de55699cf6 to your computer and use it in GitHub Desktop.
Save amboutwe/63da5a51b1853ba7cbfbe4de55699cf6 to your computer and use it in GitHub Desktop.
By default, Yoast SEO does not add empty terms to the sitemap to prevent thin content issues. This code will allow empty terms to be added to the sitemap.
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Show all empty terms in Yoast SEO sitemaps
* Credit: Yoast team
* Last Tested: 03 Jan 2025 using Yoast SEO 24.1 on WordPress 6.7.1
*/
add_filter('wpseo_sitemap_exclude_empty_terms', '__return_false');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment