- This topic has 1 reply, 2 voices, and was last updated 4 years, 8 months ago by Andrew Misplon.
Tagged: h2 tag
- AuthorPosts
- April 25, 2020 at 10:01 pm #14292
Rafa MonllorParticipantCheers,
I have installed the ultra-pro theme on several of my websites and I note that there are two h2 tags that cannot be controlled and that do not refer to any part of the content on the web.
Would you be so kind as to let me know how I can remove h2 from this content that is not relevant to web SEO?
This is the list of labels that appears in one of the entries:<H1> Quartz
<H2> Post navigation <——————————–
<H3> Quartz
<H2> Post navigation <——————————–
<H3> Rafa Monllor
<H3> You may also like
<H3> Aragonite
<H3> Citron Quartz
<H3> Tectosilicates
<H3> Leave a reply Cancel reply
<H3> CategoriesWhat is “post navigation”? I think it shouldn’t be h2.
Thank you in advance for your consideration.
P.D.: Sorry for my english so horrible
April 26, 2020 at 9:09 am #14293
Andrew MisplonKeymasterHi Rafa
Thanks for reaching out.
Ultra is using
the_post_navigation
, you can read more about that function https://developer.wordpress.org/reference/functions/the_post_navigation/. Theh2
tags are outputted as part of that function and not directly included in Ultra.The
h2
tags in question are for screen readers so they are never seen by regular browsers, only for those users making use of screen readers.We can use the following filter to change the WordPress core screen reader markup https://developer.wordpress.org/reference/hooks/navigation_markup_template/.
If you aren’t using a child theme, install a plugin called Code Snippets. Then go to Snippets > Add New, name the snippet as you’d like and insert into the snippet body:
function ultra_navigation_markup_filter( $template, $class ) { return str_replace( 'h2', 'span', $template ); } add_filter( 'navigation_markup_template', 'ultra_navigation_markup_filter', 10, 2 );
Finally, enable the option to run the snippet on the site front-end and click Save changes and activate.
I hope that helps.
Your english is perfect 🙂
- AuthorPosts
You must be logged in to reply to this topic.