I am trying to get rid of the health error:

[MissingFeature] Database [WSS_ContentDB] has reference(s) to a missing feature: Id = [id]

I followed this link Removing features from a content database and it works fine for all the errors less one.

I tried to get the feature with this, but no results:

Get-SPFeature | ? {$_.Id -eq "myId"}

I checked also on the contentDb in the table dbo.Features without success.
Where can be the reference of this feature?

I found the feature in the table dbo.FeatureTracking but it is linked to a site that does not exist.

  • Can you provide more information on the error like a snapshot of the error and also can you tell that the site it is showing the feature is linked to was ever created and deleted or not? Commented May 6, 2015 at 12:28
  • Is it a sitecollection or a subsite it points to? Subsites are stored in the recycle bin for 30 days and then the site collection recycle bin for 30 days, so the site does still "exist" in the recycle bin and thus the content database. Go to the recycle bin and delete it from the user recycle bin and then from the site collection administrator bin. If it is in a deleted site collection, the site collection is stored for deletion as well but can only be accessed and deleted or restored using PowerShell. Run get-spdeletedsite to make sure, if the site is there, use removee-spdeletedsite cmdlt. Commented May 6, 2015 at 12:44

3 Answers 3


This is a very handy tool in such scenarios:

Feature Administration and Cleanup tool

  • I tried it, it say there are no issue, but the error is still in the health report
    – Nk SP
    Commented May 6, 2015 at 12:24

I usually succeed using this script

    1. To run the script - add your GUID on the last line of this script

       [MissingFeature] feature:ID [8307a780-2546-f10b-551f-0e692d0fce39] 

    2. Add your SqlServer name and instance on the last line of this script.

if ($ver.Version.Major -gt 1) {$host.Runspace.ThreadOptions = "ReuseThread"} 
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"

function Run-SQLQuery ($SqlServer, $SqlDatabase, $SqlQuery)
    $SqlConnection = New-Object System.Data.SqlClient.SqlConnection
    $SqlConnection.ConnectionString = "Server =" + $SqlServer + "; Database =" + $SqlDatabase + "; Integrated Security = True"
    $SqlCmd = New-Object System.Data.SqlClient.SqlCommand
    $SqlCmd.CommandText = $SqlQuery
    $SqlCmd.Connection = $SqlConnection
    $SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter
    $SqlAdapter.SelectCommand = $SqlCmd
    $DataSet = New-Object System.Data.DataSet

Run-SQLQuery -SqlServer "SQLSERVER\INSTANCE" -SqlDatabase "Content_CentralAdmin" -SqlQuery "SELECT * from AllDocs inner join AllWebParts on AllDocs.Id = AllWebParts.tp_PageUrlID where AllWebParts.tp_WebPartTypeID = '8307a780-2546-f10b-551f-0e692d0fce39'" | select Id, SiteId, DirName, LeafName, WebId, ListId, tp_ZoneID, tp_DisplayName | Format-List
  • Thanks, but it is not working, I used this to solve the MissingWebPart error, not the MissingFeature
    – Nk SP
    Commented May 6, 2015 at 12:52
  • @NkSP OK. Sometimes it works, sometimes i doesn't. Too bad it didn't work this time :-/
    – Benny Skogberg
    Commented May 6, 2015 at 12:58

There is no need to edit or run any sql database query or operation. the most simple way is to use powershell and the error is removed.

As shown, the message reports a content database name (SharePoint_Content_Portal) and feature ID (8096285f-1463-42c7-82b7-f745e5bacf29), but not the sites or site collections where the feature exists. In addition to this, even if you did know where the feature was activated, it will not appear anywhere in the UI for you to deactivate because the solution has been removed from the farm.

The following PowerShell script will interrogate a specified content database and feature ID and do two things:

  1. Produce a report in the PowerShell console showing which sites or site collections contain the offending feature.
  2. Forcibly deactivate the feature from the applicable sites or site collections.

The complete answer lies here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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