Remove all the rotten potatoes from your pantry. Be sure to check behind items, as even one potato left behind will continue filling your pantry with its smell. Dispose of the potatoes in an outside trash can.
Mix equal parts white vinegar and water in a spray bottle. Spray the vinegar solution anywhere the potatoes have been, and scrub the area with paper towels. Vinegar disinfects and helps remove the odor.
Pour 1/2 to 1 cup of dry coffee grounds into a small bowl. Place the bowl in the pantry in a spot where it will not get knocked over. Close the pantry door, and allow the coffee grounds to draw the rotten potato smell out of the closed space. Although you may notice a small improvement immediately, it can take several hours for the smell to completely fade.