SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i would like to prevent corev4.css from loading for a public site (100% anonymous) to reduce pages size. any suggestions please ?

share|improve this question
Why do you want to prevent corev4.css when that's the CORE css? What are you trying to accomplish by reducing page size? – Mike Jan 14 '13 at 19:57
@Mike corev4.css is used for backoffice in my case i use a personalized css, soo i dont need the CORE css – Mahmoud Jan 15 '13 at 10:45

There is no way to accomplish this in a way that suits your goal. SharePoint will always add its CSS to each page. You could remove it client-side, but that doesn't solve your issue of reducing page size.

For public-facing sites, I have used Aptimizer (now owned by Riverbed):

Tools like Aptimizer compress, consolidate, etc., everything at the IIS level. Might be worth a shot.

share|improve this answer

I don't think it's 'impossible', because there is the

<SharePoint:CssLink runat="server" Version="4"/> 

control in the master page which you can conditionally replace with other kinds of references to stylesheets you need on your publishing site.

share|improve this answer
can you explain more please – Mahmoud Jan 30 '13 at 15:15

You need to make a custom control which inherits CssLink, and in that you need to make some logic which prevents the COREV4.css to be loaded based on some condition.

public partial class CustomCssLink : CssLink
    protected override void OnPreRender(EventArgs e)
        // Logic here
share|improve this answer

Why can't you create a custom master page and remove the < SharePoint:CssLink runat="server" Version="4"/> from the markup?

SharePoint will then not add the css file to the request and you will get a much "lighter" page. But then every out of the box control's css will have to be re-entered from your branding project in any case you are using the out of the box controls.

If you are making a public facing site the I assume that you have a custom master page and custom page layouts anyways and you are not in need of all the css that's inside of SharePoint?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.