I want to remove tag, category classes from Post Titles of my WordPress blog. On the frontend, Wordpress generates extra classes for every single article title.
For Example, this article, has these article title classes "category-tips-guides" "tag-indian-army" as displayed in the following image:
I have tried the following snippet to remove some extra classes (shared on this page) and it works:
function lsmwp_remove_postclasses($classes, $class, $post_id) {
$classes = array_diff( $classes, array(
'hentry',
'type-' . get_post_type($post_id),
'status-' . get_post_status($post_id),
) );
return $classes;
add_filter('post_class', 'lsmwp_remove_postclasses', 10, 3);
But the issue with this code is that it doesn't remove any Tag, Category classes as I want.
Some References to post_class: