Tagged: woocommerce
We’re using the product-category description-textfield which Enfold is displaying as a headline (H1) in frontend.
Problem is, that it’s nesting a P tag inside, so SEO tools are complaining about.
How can this be removed?
Hi boehmmedia,
I can’t seem to reproduce the same issue.
Can you give us a link to your product category page? so we can inspect it.
You can post it in private content.
Best regards,
Nikko
sure, there you go.
ps: there is no paragraph or whatsoever tag in the editor (clear text).
Hi,
Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:
function remove_product_category_description_paragraph_tag() { ?>
<script>
window.addEventListener('DOMContentLoaded', function() {
(function($){
$('#av_product_description h1 p').contents().unwrap();
})(jQuery);
});
</script>
<?php
}
add_action('wp_footer', 'remove_product_category_description_paragraph_tag');
Then clear your browser cache and any cache plugin, and check.
Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
Best regards,
Mike
Hello Mike
your javascript works, thanks!
But why is the P tag added at all?
Hi,
Glad to hear this helped, I’m not sure why this is but I have asked the Dev Team to review and I will write back when I hear from them.
Thank you for your patience and using Enfold.
Best regards,
Mike
Hi,
Thank you for your patience, the Dev Team found that the p tag was added by WordPress from the wpautop function due to the textarea field used in the theme option. They have added a filter to correct in the next update avf_wc_parallax_banner_tag
So after the next update you can remove the solution posted above.
Unless there is anything else we can assist with on this issue, shall we close this then?
Best regards,
Mike