In this work, walnut green husk has been used as a simple, cheap, biodegradable, and efficient adsorbent in dispersive solid phase extraction of Cd(II) and Pb(II) ions from some oil samples including edible, fish oil, and butter. In the next step, a dispersive liquid-liquid microextraction method was used to enrich the extracted analytes before their analysis with flame atomic absorption spectrometry. For this purpose, the adsorbent was obtained from agricultural wastes, dried in an isolated environment at ambient temperature, and mechanically ground to obtain a homogeneous powder. The parameters affecting the efficiency of the method were optimized. Low detection limits (0.12 and 0.32 µg l-1 for Cd(II) and Pb(II), respectively), low relative standard deviations (3.8% and 4.2% for Cd(II) and Pb(II), respectively), and determination coefficients close to 1 (0.991 and 0.995 for Cd(II) and Pb(II), respectively) were achieved. Also, the extraction recoveries for the target analytes were 89 and 96% for Cd(II) and Pb(II), respectively. [ABSTRACT FROM AUTHOR]