Custom CSS showing in page code

Hi Themeco Team,

We use SEMrush to run audits on our website, content, etc. and for the last several months, the audit reports we’ve been seeing show that about half of our pages have “multiple H1 tags.” Upon closer inspection, we are seeing that the custom CSS we added on the backend, which includes tweaks for H1 tags, is being included in the code for many of our pages, and we believe this is triggering these warnings that are potentially negatively affecting SEO.

Can you provide a recommendation on how we can resolve the issue of our custom CSS being included in the code on our site’s pages? Is there a way to link to the custom stylesheet instead?

Thanks!

Hi Robert,

Thank you for reaching out to us. You can move all of your Custom CSS to your child theme’s style.css file. If you’ve not already setup the child theme I’d recommend you to please follow https://theme.co/apex/forum/t/setup-how-to-setup-child-themes/57

Let us know how this goes!

Thank you for the quick response! We actually already tried that but the CSS is still showing in the page code. Can you make another suggestion?

Hello Robert,

Thanks for updating the thread.

If you have moved all the CSS to child theme style.css file then the CSS should not be visible in the page code and those CSS will load from the style.css file. Please make sure that you have removed all the custom CSS and also please make sure to clear cache.

In case issue is still there, please share the website URL in question here for us to take a closer look.

Let us know how it goes.

Thanks.

Thank you!

Hi Robert,

There are actually two H1 tags on the page that you have mentioned. It is not related to the generated CSS code. Please kindly follow the steps below:

  • Copy this file: wp-content/themes/x/framework/legacy/cranium/headers/views/renew/_landmark-header.php
  • Into this: wp-content/themes/x-child/framework/legacy/cranium/headers/views/renew/_landmark-header.php
  • Create a necessary folder in the Child theme if you do not have the folders already to copy the file.
  • Open up the newly copied file and change all the instances of H1 tag to another tag such as DIV.
  • Make sure that you change both opening and closing H1 tags.

Here is more information about how to customize the Theme using the Child Theme which you already have installed:

Thank you.

Thank you!

You are most welcome!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.