Finding the cause of a relentless foul odor in your bathroom may not always be easy. By troubleshooting these common causes with the help of a professional, you can get rid of bad smells and ensure they don't come back.
Broken Toilet Wax Ring
One of your toilet's components is a wax ring that provides an airtight seal with the floor and drain beneath. Not only does this ensure that no liquids or waste leaks from underneath the toilet, but it also ensures that gases from your sewer or septic tank don't come back up the drain and out into your bathroom.
If this seal cracks or breaks or otherwise loses its airtight seal, sewage fumes could start to seep into your bathroom. This doesn't necessarily happen constantly, so you may only notice the odor every so often. If you notice this odor independent of any actual bathroom use, this could be a good indicator that the wax ring is the problem. Fixing this problem usually requires only that the ring be replaced, which a plumber can take care of for you.
If these measures don't fix the problem, ask your plumber to inspect your bathroom for cracked or loose drain pipes, as this can result in the same issue of sewer gases coming back into your bathroom.
Water Heater Issue
One way to narrow down the source of the odor is by trying to establish if you only smell it when hot water is running. If so, this is likely a result of sulfate gases from your water heater. This gas can build up for a few different reasons. For example, sometimes it comes from hot water that has sat in the tank for too long or water that isn't being treated properly, or as a result of a water softener that's interacting with a magnesium anode rod.
Since these odors usually don't come from damage to your water heater, you likely won't need to have yours replaced, though your plumber may suggest maintenance to prevent the problem from happening again. For example, having your tank flushed annually can help prevent these gases from building up.
Gunk Buildup in Drains
Drains, especially those in bathtubs and showers, can quickly fill with hair and cleaning products that become trapped together and promote bacterial growth. This bacteria in turn can start to emit foul smells, especially in drains that haven't been cleaned out in some time.
The bulk of the odor can usually be removed by removing physical obstructions, though, with particularly stubborn clogs or bacterial films that run deeper into your pipes, you may need the assistance of a plumber to remove the odor completely. On top of removing clogs, they can also recommend cleaning regimens that are safe for your plumbing system. Not all cleaners are alike, and you'll need to factor in the materials your pipes are made of as well as whether you are on sewer or septic. For more information, contact a plumbing contractor.