When you use cloth diapers sometimes cloth diaper funk happens. Slight changes can cause a little bit of funk so it's important to go over your routine and figure out what could suddenly be causing this stink.
Some possible reasons for malodorous diapers could be starting solids, changes in water, dehydration, not enough detergent, too much detergent, and slight changes in your wash routine.
Whether it's barnyard stink or ammonia, stinky diapers can cause stress and may lead to you giving up on cloth diapering all together. In most cases, this can be cured by slight, simple modifications to your laundry routine. Cloth diaper laundry should never be difficult.
Barnyard Stink - this is usually cured by adding more detergent or, if you have hard water, adding a water softener such as Calgon, Rain Drops, or even plain old washing soda so your detergent can work more efficiently.
Ammonia - there are a few causes of ammonia/urine to be left in your diapers. Before you get all freaked out about it determine when they smell. If it's just the overnight diaper that stinks or they stink after sitting in the pail for a few days then this is completely normal. There is no need for alarm. Just wash the diapers and be on your fluffy way. If they still smell after being washed then it's time to hold the phone and take action.
Use more detergent. Yes, more! No matter how you slice it a tablespoon of detergent (or even less!) isn't going to clean your diapers. Think about what you're trying to clean - urine and feces that have been sitting in a closed pail or wet bag for 2 or 3 days. They need to get clean and that requires detergent. If you are already using the recommended amount of detergent then you may need a new, stronger detergent. Experiment and find one that works for you.
You could have detergent residue in your diapers that is reacting with the urine to cause them to smell. Go for the simple approach first and rinse, rinse, rinse with as much HOT water as your machine will allow. If you have an HE machine there are ways to help increase your water amount but do not add more water by dumping it in the detergent reservoir or the drum or it may damage your machine. Instead, you can use the bulky/bedding/comforter setting. You may have to rinse a few times to get the residue out. When this happened to me I had to rinse four times. If that doesn't work...
Use a squirt of Bac-Out on your inserts and fitted diapers before putting them in the diaper pail or add some to your wash cycle.
Some people swear by vinegar in the rinse cycle if you have soft to normal water. Beware that if you have hard water this could cause a reaction and your diapers may actually smell worse.
If you're comfortable with it, you could try a little bleach. Personally, I don't find bleach to be necessary and have only used it on my diapers once or twice. For me, upping my detergent usually fixes most diaper laundry problems but it's an option.