• I use the Custom Community theme and when I looked at my site source code just now I noticed it displays all the CSS, presumably pulled through from a php file because there’s no spacing etc.

    I don’t want the CSS displayed like this – I’m not bothered about anyone ‘stealing’ the design because it’s a theme anyway, but it’s not good SEO practice. So how do I hide it?

    I know how to use external style sheets but I’m not sure how to hide it as a php file…

    view-source:http://www.charmedgeek.co.uk/

Viewing 1 replies (of 1 total)
  • You have some embedded CSS but not anywhere close to all of it as you believe. Your site loads three external CSS files as well.

    For the record, there is no issue with ‘stealing’ whether that concerns you or not. CSS is always exposed. You can read the stylesheet for any site that uses one.

    I am not convinced that you need to worry about the SEO consequences of your embedded styles. Yes, there is some debate, but I am not convinced it is something you need to worry much about.

    Finally, I don’t know how your theme works, but you probably can’t hide that CSS. Things will break. I am guessing that you theme has options for changing the background, changing fonts, maybe font sizes, things like that. If that is true, you may not be able to hide that CSS. Your theme needs a way to insert that into the page. CSS is not dynamic like PHP. Probably the only reliable way to insert it is the way it is done on your page.

    You can get a server to parse a CSS file as if it were PHP and you could actually write to a stylesheet with PHP, but there is overhead to both of those methods and both are dependent upon server configuration and server permissions so they wouldn’t be reliable mechanisms to use in a published theme.

Viewing 1 replies (of 1 total)

The topic ‘Need to hide CSS’ is closed to new replies.