Batch-type experiments were used to study cadmium (Cd) and lead (Pb) sorption/desorption on forest soil, vineyard soil and pyritic material samples, on the by-products mussel shell, oak ash, pine bark and hemp waste, and on forest soil, vineyard soil and pyritic material amended with 48 t ha −1 of oak ash, mussel shell, and hemp waste. The main results were that the forest soil showed higher Cd and Pb retention than the vineyard soil and the pyritic material. Regarding the byproducts, sorption was in the following order: oak ash > mussel shell > hemp waste > pine bark, with desorption following an inverse sequence. The pH was the parameter that most influenced Cd and Pb sorption. Cd and Pb sorption curves showed better fitting to the Freundlich than to the Langmuir model, indicating the dominance of multilayer interactions. Oak ash and mussel shell were the amendments causing higher increase in Cd and Pb sorption on both soils and the pyritic material (close to 100% with the oak ash amendment), as well as more a pronounced decrease in desorption. These results could be used to favor an effective management of the by-products studied, which could retain Cd and Pb in soils and degraded areas, preventing water pollution.