When foam persists in a fountain, beyond a normal amount of bubbling from the water's action, the fountain has dissolved organic compounds (DOCs). Sunlight promotes decay of organic matter and algae growth. The more impurities in the water, the more likely it is to foam. If you have fish in a fountain, their food and wastes also contribute to foaming. Whether or not your fountain is inhabited, a few basic techniques will help keep foam out of your water fountain.
Clean the fountain. Turn off or unplug the fountain pump and remove the water by opening the drain, if it has one, or bailing all the water out and sopping up excess with a towel. Scrub the fountain with a scrub brush, using a solution of 1/2 cup of vinegar and 1 qt. of water. Rinse the fountain thoroughly if you keep fish in the fountain.
Soak the fountain pump in a bucket with 1 qt. of water and 1 cup of vinegar overnight to remove mineral deposits and residue from chemicals and organic debris.
Move the fountain into the shade or at least partial shade, if possible. Avoid locations where excessive debris will fall into the fountain, such as directly under a plant that drops leaves regularly.
Put the clean fountain pump back in place. Refill the fountain with distilled water, if possible.
Add 1 tbsp. of vinegar per gallon of water in the fountain, if it doesn't have fish. Vinegar helps prevent mineral buildup and algae growth.
Skim debris such as leaves and flower petals out of the fountain at least once a week to prevent impurities from decaying matter causing foam.
Avoid foaming by cleaning the fountain thoroughly at least once a month.