Archived topic
in category pages
3 replies · Started by Karsten M. e.K. on September 2, 2021
Hi there,
I am not really a SEO-Expert, but I see that every post title on my category pages is in <h2>, I have 50 posts on every single category page (jokes) and I am not sure, if it is too much... Does it make sense to have 50 <h2> titles?
So, is there a way to change <h2> in <p>?
What do you guys think?
Thanks and best regards
Michael
Hi there,
I don't think it matters if there were 5 or 50 H2s. Each H2 is a heading for an Article, so one would expect to see them there, no matter how many.
If you did want to change them from a H2 to a P, then you could use this PHP Snippet:
add_filter( 'generate_get_the_title_parameters', function( $params ) {
if ( ! is_singular() ) {
$params = array(
'before' => sprintf(
'<p class="entry-title"%2$s><a href="%1$s" rel="bookmark">',
esc_url( get_permalink() ),
'microdata' === generate_get_schema_type() ? ' itemprop="headline"' : ''
),
'after' => '</a></p>',
);
}
return $params;
} );
Ok, thank you very much!
You're welcome