When using a foam pillow, care should be taken not to expose the foam pillow to moisture of any kind. Any moisture that comes into contact with a foam pillow can quickly be absorbed deep within the pillow, preventing it from evaporating fully and allowing bacteria to grow. A dry foam pillow will not propagate bacteria.
If a foam pillow is washed, it can take a very long time to dry completely deep within its foam core even if it appears to be dry to the touch on the outside. This excess water inside of the pillow can create a haven for bacteria, or lead to a mold and mildew problem inside of the pillow. This type of bacteria or mold growth can aggravate allergies, cause the pillow to smell or otherwise render the pillow unusable.
Because foam pillows should not be washed, a waterproof cover should be used to prevent stains that would require washing. Other covers, such as allergen covers, are designed to be airtight and prevent the user from coming into contact with bacteria, dust mites or allergens that could be found in the pillow. Foam pillows that are made of special anti-bacterial foam are also available, which would eliminate the need for a cover.
If a foam pillow must be washed, for example after a flood where it has been contaminated, Pennsylvania State University recommends using cold water and detergent and then hanging the pillow until completely dry.