This article looks at how to get rid of mouldy, musty or bad smells from washing machines, and points to the causes so as to protect from the problem in the first place or prevent re-occurrence.
There are various products available online and in supermarkets claiming to freshen up washing machines and get rid of bad odours. My personal experience with these products (which are also aimed at dishwashers) is that they do a good job of freshening up a relatively clean washer or dishwasher but are not so good at curing a genuinely smelly one. If your appliance is seriously smelly, especially if coated in black mould or greasy gunge, then it can be very difficult or even impossible to cure but there are some things worth trying..
Carry out one or more maintenance washes

90° or 95°
Also, you could try to clean the washing machine inside using soda crystals which dissolve grease. I recommend putting half a packet inside the drum and washing on a boil wash (or follow instructions on the packet). Using this method every month or so, or using ordinary detergent if no soda crystals are available can help prevent smells from your washing machine. If your washing machine is badly affected by grease and slime, it may be very difficult to remove it.
Get rid of washing machine odours using vinegar
White distilled vinegar has an array of uses. Try putting half a cup of white (distilled) vinegar inside an empty machine and put it on a boil wash. Note that because the first bit of water goes into the sump hose and is sealed off, I recommend that you wait until the washing machine has been filling for about 15 seconds before pouring the vinegar into the soap drawer where water is running in to let it wash down into the machine. I've had reports back from people that this does actually work.
More articles related to the subject

Related Articles
- Grease, gunge and black mould in washing machines – what causes it?
- Black slimy jelly and mould inside soap dispenser
- Do you wash bedding at the right temperature to kill bed bugs?
- Low temperature washes are part of the smelly washing machine problem Washing at 30 degrees?
(This is a completely revised and updated article first published in 2002 on my other site Washerhelp )

The drain hose may be connected directly to the sink plumbing instead of being pushed into a standpipe (as above). Unless fitted properly some of the dirty smelly water poured down the sink can run down the drain hose into the washing machine. 

Apparently “Affresh” is said to be the best washing machine cleaner on the market. What do you think? Affresh also make tablets for cleaning the internals of the dishwasher.
Afresh is one of the products I meant when I said I’d found they were good at freshening up a relatively clean washer or dishwasher but not so good at curing a genuinely smelly one. Have you found it any good for particularly dirty smelly appliances?
I use affresh and it does keep the washing machine clean. I have recently used their dishwasher cleaner and you can see the difference inside the dishwasher after using the stuff. :)
I don’t know how well affresh cleans washing machines and dishwashers which are already smelly because they have not been cleaned monthly, but the instructions do say that more than one use is required in particularly dirty appliances. From what I’ve read about affresh, it’s meant to be better than bleach and it sends all of the dirty gunk down the drain. Anyway, I’m sure people call out an engineer when their washing machine or dishwasher is always smelling bad.
I’ve also found the cleaning products leave our dishwasher smelling and looking lovely (lemon) but our dishwasher is nice and clean anyway. I don’t think they can help much with a really bad smelly appliance although repeated uses may help. I’d be happy to promote any product that can genuinely cure a really smelly washing machine covered in grease slime and gunge inside.