How to remove the h6 tag for the entry-category Class

On my single blog pages at the very beginning, I have the html

h6 class=entry-category is-xsmall
    a href=www.website.com rel=category tagcategory title/a/h6

I want to remove the h6 tag from all blog pages. In this forum, I found a solution for removing the h3 at the comments:

    function my_comment_form_before() {
    ob_start();
}
add_action( 'comment_form_before', 'my_comment_form_before' );

function my_comment_form_after() {
    $html = ob_get_clean();
    $html = preg_replace(
        '/h3 id=reply-title(.*)(.*)\/h3/',
        'p id=reply-title\1\2/p',
        $html
    );
    echo $html;
}
add_action( 'comment_form_after', 'my_comment_form_after' );

I tried to change it to the h6 problem:

function my_comment_form_before() {
        ob_start();
    }
    add_action( 'comment_form_before', 'my_comment_form_before' );
    
    function my_comment_form_after() {
        $html = ob_get_clean();
        $html = preg_replace(
            '/h6 class=entry-category is-xsmall(.*)(.*)\/h6/',
            'p id=reply-title\1\2/p',
            $html
        );
        echo $html;
    }
    add_action( 'comment_form_after', 'my_comment_form_after' );

But it is not removing the h6. How can I remove it the right way?

Topic blog-page php html Wordpress

Category Web


You don't need functions for this, just look in your theme's template files: For single posts check single.php and for blog archive/categories check archive.php.

Change the <h6> in those php files to <div> or whatever you want. It would be wiser to override them with a child theme so you don't lose your changes in a future update of the theme.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.