A method for ultra-dehydrating thickened or pasty products, forming a biomass of treatment plant sludge, characterized in that the products, having a dryness of 4 to 25%, are subjected to the following steps: - hydrothermal carbonization treatment, comprising a pressurization (1, 2) and a thermal conditioning for a residence time in a closed reactor, followed by a decompression, - then dehydration of the products by a ram press, until obtaining a dryness of greater than 50%, - the temperature of the product upstream of the dehydration by the ram press being regulated by cooling between 40 and 90°C, advantageously at around 70°C, in order to optimize the filterability in the ram press, the steps of the method being carried out in a confined space that makes it possible to prevent the diffusion of odors into the atmosphere. the ram press being provided in order to carry out a pressing of the products through flexible drains that form filters, which are permeable to the liquid that passes from the outside to the inside of the drains under the effect of the pressure between two plates (12f, 12i) between which the drains extend, which drains deform when the plates approach one another, whilst the solid materials are retained on the outside of the drains in order to be discharged during the disassembling. the product to be pressed being introduced into the cylinder via a channel provided at the center of the plate, away from which a ram subjected to a hydraulic or pneumatic pressure may slide in a leaktight manner into the cylinder in order to press the products introduced into the cylinder 12, the drains, formed by flexible sheaths made of material that is permeable to the liquid but impermeable with regard to the solids, being attached to a counterplate separate from the plate, but connected thereto, each drain comprising an internal passage that opens into an associated opening, provided in the counterplate, the openings communicating with a chamber, between the counterplate and the plate, which connects the liquid, essentially water, discharged to the outside via a duct. the drains 12e being attached to a plate connected to the ram from which it is separated in order to define, with the ram, a chamber which recovers the liquid that has passed through the drains. the drains being connected to openings that pass through the plate and opening into the chamber, and the drains extending substantially parallel to the geometric axis of the cylinder when the ram is as far away as possible from the plate, so that the dehydration of the products by the ram press is carried out through flexible drains that form filters, which are permeable to the liquid that passes from the outside to the inside of the drains, whilst the solid materials are retained on the outside in order to be discharged by disassembling. - hydrothermal carbonization treatment, comprising a pressurization (1, 2) and a thermal conditioning for a residence time in a closed reactor, followed by a decompression, - then dehydration of the products by a ram press, until obtaining a dryness of greater than 50%, - the temperature of the product upstream of the dehydration by the ram press being regulated by cooling between 40 and 90°C, advantageously at around 70°C, in order to optimize the filterability in the ram press, the steps of the method being carried out in a confined space that makes it possible to prevent the diffusion of odors into the atmosphere.