To prevent wooden shelves from rotting, apply a waterproof sealant or outdoor paint. This protective layer shields the wood from moisture. Regularly inspect your shelves for signs of wear, and reapply the sealant or paint as needed.