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.


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"));


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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