Remove class names from post_class()

By default, WordPress inserts a lot of classes names in the final Html of themes. Most theme developers do not remove the class names auto-inserted by the native  WordPress post_class() function. Personally, I think it is very important to clean my theme’s code from unused classes. Extra unused classes make our Html code cluttered and even adds extra weight to it.

add_filter( 'post_class', 'wph_remove_class_names', 20 );
function wph_remove_class_names( $classes ) {
	$classes = array_diff($classes, array('hentry','status-publish'));	
	return $classes;

If you want to remove any class names from the post_class() function just paste the snippet above into your functions.php file. Then add the unwanted class names to the array. As you can see we have two class names in the snippet, ‘hentry’ and ‘status-publish’. All what you have to do is replace them with your unwanted classes and they will be removed.