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

Is there a way to determine if the Metadata Navigation and Filtering feature is activated on a site collection?

I've looped through the farm features, site features and web features but I can only find this feature at the farm level. However, this can be activated down at the site collection level.

SPFeatureCollection spfc = web.Features;
foreach (SPFeature f in spfc)

SPFeatureDefinitionCollection spfdc = site.FeatureDefinitions; //this is empty
foreach (SPFeatureDefinition f in spfdc)

I also saw TaxonomyFieldAdded but that doesn't seem to indicate that metadata is currently activated on the site collection.

share|improve this question
up vote 2 down vote accepted

If you open the page http://your/sites/coll/web/_layouts/ManageFeatures.aspx and if you look at the html structure with your favorite tools (IE dev tools can do the job), you will see that the button "Enable" of the feature has this html :


<INPUT    id=ctl00_PlaceHolderMain_featact_rptrFeatureList_ctl21_ctl00_btnActivate 
        title="Activer la fonctionnalité" 

The id of the DIV is the id of the feature you are looking for. This is useful because some features are hard to find by their internal name.

So in code, you should determine if its activated using :

public bool IsFeatureActivate(Guid featureID, SPWeb web)
    return web.Features.Cast<SPFeature>().Any(f=>f.Id == featureID);

public void Test()
    var web = GetMySPWeb();
    if(IsFeatureActivated(web, new Guid("7201d6a4-a5d3-49a1-8c19-19c4bac6e668"));

share|improve this answer
thanks. Works great. Nice note about the div id. – Eonasdan Jul 19 '12 at 14:04

This is actually a web scoped activated feature. You can find this using powershell

Get-SPSite http://yoursitename | Get-SPWeb -Limit ALL | %{ Get-SPFeature -Web $_ } | Sort DisplayName -Unique | FT DisplayName,Id

You will find the feature listed as


Just iterate the same logic through your c# code and you should comfortably get the results.

share|improve this answer
thanks for the powershell version. – Eonasdan Jul 19 '12 at 14:04

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.