Kansas State University recommends placing a container of freshly ground coffee in the refrigerator to get rid of persistent unpleasant odors. This method requires no chemicals and can help even when spoiled food has already been removed but the odor remains, according to Cronista.

The coffee should be spread out on a tray or in a shallow container and left inside. This allows a larger surface area of the grounds to come into contact with the air. As an alternative, the university suggests using baking soda.

However, this method is not a substitute for cleaning. First, you should throw away spoiled or questionable food, wash the shelves and drawers with hot water and dish soap, and clean the inside of the refrigerator.

Why Coffee Only Masks the Problem

Coffee, vinegar, and gel deodorizers act as deodorizers: they mask unpleasant odors with their own scent and can transfer that scent to other foods in the refrigerator. Baking soda traps odor molecules on its surface, but in a box, it has too little surface area for effective absorption. A more effective solution is activated charcoal; charcoal for aquarium filters costs about 35 cents per ounce, compared to 81 cents for a similar product designed for refrigerators, according to Serious Eats.

If the odor returns even after a thorough cleaning, check the condensate tray under the refrigerator. Stagnant water may accumulate there. Remove the tray and wash it with a sponge and dish soap or a bleach solution.

Coffee Is for Drinking—Not for the Refrigerator

Coffee industry experts advise against storing whole beans or ground coffee in the refrigerator if you plan to use them to make a beverage.

“Every time you open the refrigerator door, you cause a temperature fluctuation, which leads to a dangerous buildup of moisture. Plus, since coffee acts as a deodorizer, it also absorbs the odors of your food,” warns Jacob Ball, coffee director at Fire Department Coffee, in a comment to The Manual.

Mark Janasik, co-founder of Southern Grounds, emphasizes that condensation and foreign odors make the coffee taste flat and give it a strange aftertaste. For daily storage, he recommends an airtight container kept at a stable, cool room temperature.