If you want more information WHY to clean expired and superseded updates you can get more information here from Kent Agerlund.
Also thank Nickolaj Andersen who made the script that does all the work!
Download the file here.
When the file is open you have to change three values , the first value we have to change is the SiteCode , so change the marked SiteCode S01 ( se the picture ) to the SiteCode you are using where you want to clean updates.
The second value we have to change is the “Client” value, this value represents the name of the software update group or groups that you want to clean, for example. If you have 10 “Client” groups and you want to clean all of those, you enter “Client” and if you have five different “Server” groups you change the value to “Servers”. This script will always take every group with the name you enter in the script.
The third and last value we are going to change is the “SiteServer” name ( se picture ) this can be any server with a provider installed ( I usually run this script on the primary site server then you know it will work , if you are not sure how many providers you have on your site ). After you have change the value go ahead and try to run the script.