
-
AuthorPosts
-
May 24, 2025 at 10:53 am #1484609
Dear Support!
i found different solutions in the forum, but i`m not sure which one is working out for me.
per default, there is a h1 headline from the title of the site.
i want do disable this (not only by display none), and show my own h1 in the category text.
just this one should be found.at the moment, i have 2 h1 on these pages.
thanks for your quick support!
May 24, 2025 at 5:31 pm #1484611Hey awasner,
To change the title bar H1 for category pages to a different tag like H2 or p, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function my_custom_change_category_title_tag($args) { if (is_category()) { $args['heading'] = 'h2'; // Change title tag from h1 to h2 or any other tag like p } return $args; } add_filter('avf_title_args', 'my_custom_change_category_title_tag');
To remove the title in the title bar for category pages, but still show the breadcrumbs, try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function avf_header_setting_filter_mod($header_settings) { if ( is_category() || is_archive() ) { $header_settings['header_title_bar'] = "breadcrumbs_only"; } return $header_settings; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1);
If you want to completely remove the title bar, both title and breadcrumbs use this function instead:
function avf_header_setting_filter_mod($header_settings) { if ( is_category() || is_archive() ) { $header_settings['header_title_bar'] = "hidden_title_bar"; } return $header_settings; } add_filter('avf_header_setting_filter', 'avf_header_setting_filter_mod', 50, 1);
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
MikeMay 26, 2025 at 5:07 pm #1484698This reply has been marked as private.May 26, 2025 at 7:45 pm #1484706Hi,
The snippets above are for the theme category pages, not woocommerce product category pages, the H1 title on your page is from woocommerce.
In this case use this code to the end of your child theme functions.php file in Appearance ▸ Editor:function custom_script() { ?> <script> (function($) { $(function() { function replaceElementTag(targetSelector, newTagString) { $(targetSelector).each(function(){ var newElem = $(newTagString, {html: $(this).html()}); $.each(this.attributes, function() { newElem.attr(this.name, this.value); }); $(this).replaceWith(newElem); }); } replaceElementTag('.archive.woocommerce h1.woocommerce-products-header__title', '<h2></h2>'); }); }(jQuery)); </script> <?php } add_action( 'wp_footer', 'custom_script', 99 );
Best regards,
MikeMay 27, 2025 at 10:17 am #1484718This reply has been marked as private.May 28, 2025 at 8:57 pm #1484788Hi,
When I check your page source code there is only one H1, the one that you manually added further down on the page. Your screaming frog plugin may be checking the page before the javascript runs, the “woocommerce-products-header__title” is a H2, Google Bot will not see two H1’sBest regards,
Mike -
AuthorPosts
- You must be logged in to reply to this topic.