A method for cleaning a machine for liquid or semi-liquid food products having a container forming a processing chamber, a mixer inside the processing chamber, and a thermal treatment mechanism to exchange heat with the processing chamber. The method includes a) pasteurizing a basic mixture or finished product in the container at a first time interval; b) performing the following operations at a second time interval: emptying the basic mixture from the container, washing the container using a washing fluid, filling the container with a cleaning fluid and subjecting the cleaning fluid in the container to a heating thermal treatment; c) disassembling and cleaning at a third time interval components of the machine which make contact, in use, with the basic mixture or product, where the first time interval is less than the second time interval and the second time interval is less than the third time interval.