Custom CSS shows up in 'view source'

Hi,
I have added some extensive Custom CSS to the customiser. I understand that copying this to a child theme CSS file doesnt really work. That’s fine - but the thing that concerns me is that the custom css is all outputted raw as part of the page code, rather than referred to separately as a file. So if someone hits ‘view source’ they’ll immediately see my custom css with all my specific notes etc. Is there a way of sorting this out? Preserving the Custom CSS changes but as a referred file?
Thanks
Will

Hi Will,

There is really no clear way of hiding your custom CSS as every website you check, you can see their custom CSS when you inspect the code. What I can suggest is that you minify your CSS code after editing it and it will be less readable for users even if they will inspect the source.

As for adding the CSS code in a file, adding it in the style.css file should work fine but sometimes, you might not see the code take effect right away as what is being loaded is the cached version of the file which is not the most updated one. In case this happens, try to clear your browser cache or load the site in private or incognito mode.

Hope this helps.

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