A machine for producing and dispensing liquid and semi-liquid consumer food products such as ice creams, whipped cream, yogurt and the like comprises a container for a basic product of the consumer food product, a feed and treatment circuit for the basic product, comprising a feed pump, dispensing means positioned at an outfeed end of the feed and treatment circuit, and a device for checking the bacterial load of the product during production/dispensing; an electronic control unit controlling and regulating the various steps for measuring the bacterial load.