Storing onions in a cabinet is not always a good idea. If they end up rotting or have a strong odor, the smell will permeate the wood and everything porous inside. It is possible to get rid of the odor without sanding the doors or completely cleaning it out from top to bottom. The items inside can be salvaged as well.
I forgot about a bag of yellow onions in my cabinet, but the problem was easy to remedy. I knew how to get rid of the odor. I did not use sprays or cleaners in an attempt to cover up the strong and unpleasant scent. It would have smelled worse than ever. I used natural ways to completely get rid of the smell.
Begin by Removing All Traces of Onions
Before you can get rid of an odor of onions in a cabinet, the source must be fully removed. Remove everything from the shelf, and use a clean dishrag that has been dampened with a water and baking soda mixture. Rinse out the cloth with clear water, and go over the shelf a second time. Dry it thoroughly, and do not close the door until it is completely moisture free. It will be clean, but the smell of onions might not be gone. Continue with one of the following easy solutions.
Use an Open Bowl of White Vinegar
When trying to get rid of the smell of onions in a cabinet, place a bowl of white vinegar inside. Wait until the cabinet is completely dry since the door will need to be closed. Allow the vinegar to work for at least 48 hours. The cabinet will smell like vinegar at first, but the odor of onions will be gone, and the scent of vinegar will finally dissipate.
Another Option is Freshly Ground Coffee
I used freshly ground coffee to get rid of the smell of onions in my kitchen cabinet. My ex husband used it in his musty semi truck, and I knew that if it worked in his truck it would work to get rid of the stench of onions in my kitchen cabinet. Pour freshly ground coffee into a bowl, and place it in the cabinet for at least 48 hours. It will completely get rid of the smell of onions in the cabinet. Do not worry about trying to get rid of the odor of coffee. It smells much better than onions, and it will slowly fade and eventually disappear.
Source: Personal and Professional Cleaning Experience