Most carpet shampoo manufacturers make a nonfoaming product or a defoaming additive. Carpet shampoos are a bit on the pricey side, and many products in your cupboards will clean your carpets just as well if not better than commercial products.
Vinegar does not foam and has a great reputation for cleaning well. Combine one part vinegar with 10 parts water. This mixture can be used in a hand sprayer for spot cleaning, or pour it into the shampoo dispenser on your carpet shampooer.
If you do not have pets you can use ammonia and water. Be sure the room is well ventilated until the carpets are dry.
Carpets that have been cleaned with foaming shampoos can look dirty and dingy because of residue. If carpets are not properly rinsed after shampooing, the shampoo residue left behind becomes a dust magnet. Spray some club soda on high traffic areas, then use only hot water in the shampooer to clean the entire floor. You will be surprised at how clean it looks. Carpets will stay clean longer without a sticky residue.
To get rid of carpet odors, mix 1 cup of fabric deodorizer (comes in a spray bottle) with 1 gallon of water. Use this mixture to remove odors and refresh carpets. Prior to removing odors you should spot clean stains with vinegar or club soda.
By adding just a few drops of an essence oil, such as lavender or jasmine, to the water in your carpet shampooer, you will have a lightly scented fresh carpet. Do not use more than 10 drops per gallon of water. Spot clean stains prior to shampooing.