When I run into this problem, here is what I do:
Throw diapers & wet bag into laundry. Do a cold water soak with baking soda (about 1/4 cup) added, and leave overnight (or at least a few hours, the longer the better). Do 1 cold water wash and rinse cycle with no soap.
Then do a hot water wash & cold rinse with soap, and add 1/4 cup of vinegar to the rinse cycle (at the time you would normally add fabric softener).
Then do another cold water wash & rinse. Smell the diapers--if they still smell, rinse them a few more times.
If possible, hang outdoors in the sun to dry.
Also, clean out your diaper pail with soap & water; you can do an optional baking soda soak on this too, if needed. Let it air dry outdoors in the sun if possible.
I have also found that it helps to periodically switch laundry detergent. 90% of the time, I use Charlies Soap. About 9% of the time, I use Biokleen unscented laundry powder. About 1% of the time I use Tide Free & Clear. (So I maybe use Tide once or twice per year, Biokleen maybe 1x per every 2 months).