Skip to content

Instantly share code, notes, and snippets.

@andpiazza
Created August 10, 2018 05:37
Show Gist options
  • Save andpiazza/8e12d930c8bdadf79220a51b4f4b1d5a to your computer and use it in GitHub Desktop.
Save andpiazza/8e12d930c8bdadf79220a51b4f4b1d5a to your computer and use it in GitHub Desktop.
Removes hentry class entries from Wordpress pages, categories and tags. SEO benefits for the website: eliminate related errors from Google Search Console > Structured Data > hatom (markup: microformats.org)
function themeslug_remove_hentry( $classes ) {
if ( is_page() OR is_category() OR is_tag()) {
$classes = array_diff( $classes, array( 'hentry' ) );
}
return $classes;
}
add_filter( 'post_class','themeslug_remove_hentry' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment