Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created January 17, 2012 23:54
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jaredatch/1629862 to your computer and use it in GitHub Desktop.
Remove hentry from post_class()
<?php
/**
* Remove 'hentry' from post_class()
*/
function ja_remove_hentry( $class ) {
$class = array_diff( $class, array( 'hentry' ) );
return $class;
}
add_filter( 'post_class', 'ja_remove_hentry' );
@andpiazza
Copy link

Reason why this code does NOT work is: it removes hentries from posts, when in reality it needs to remove from pages, categories and tags.
If anything, removing hentries from posts might HURT your SEO results: hentries are designed to capture articles' meta data so that's exactly where you want it to show.

I posted here code that does removes hentries from pages categories and tags: https://github.com/andpiazza/remove_hentry_wordpress

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