How to remove hentry schema from WordPress?

By default WordPress adds hentry schema to the website, to remove schema add the following code to functions.php

function themes_remove_hentry( $classes ) {
	if ( is_page() ) {
		$classes = array_diff( $classes, array( 'hentry' ) );
  	}

  	else
  	{
  		$classes = array_diff( $classes, array( 'hentry' ) );
  	}
	return $classes;
}
add_filter( 'post_class','themes_remove_hentry' );