In the derived category of a commutative noetherian ring, we explicitly construct a silting object associated with each sp-filtration of the Zariski spectrum satisfying the “slice” condition. Our new construction is based on local cohomology and it allows us to study when the silting object is tilting. For a ring admitting a dualizing complex, this occurs precisely when the sp-filtration arises from a codimension function on the spectrum. In the absence of a dualizing complex, the situation is more delicate and the tilting property is closely related to the condition that the ring is a homomorphic image of a Cohen–Macaulay ring. We also provide dual versions of our results in the cosilting case.