When working with SPWebConfigModification entries to add settings to web.config files on SharePoint 2010 farms, you might run into the situation where these are not functioning correctly anymore. Either the entries are not being added anymore or old values from many versions back are still being pushed into the web.config files. I've seen many strange solutions to this problem on blogs on the internet. Some even proposed hacking the SharePoint database to get those values out. That is obviously very unwise to do so and will bring your installation in a no longer supported situation by Microsoft.
There is an easy way to accomplish the same using the allmighty PowerShell. Follow the steps below to get rid of those corrupt SPWebConfigModification entries: