I downloaded a model and found that there were way more vertex groups than bones in the armature. Is there a way to delete all vertex groups that are not assigned to a bone?
You may first wish to make sure these vertex groups aren't being used for something else such as particles, shape keys, modifiers, etc. Vertex groups are used for a lot of different things besides just bone weights. But assuming you still want to remove these groups, it can be done like this:
Make sure all the bones of the armature are visible. With the armature selected, go to the
Object Data Propertiestab of the properties panel, and make sure all the Layers with bones in them are visible (the ones with a dot have bones). Shift + click to select multiple layers.
Enter weight paint mode. From object mode, first select the armature, then select the mesh by Shift + clicking on it. Press Ctrl + Tab and select
Select all the bones by pressing Ctrl + A
Lock the selected groups from the menu at the top of the viewport.
Lock Only SelectedOr if you want to preserve some other vertex groups as well, use
Lock Selectedinstead, and make sure all the groups you want to keep are locked.