Oily sludge is a hazardous waste of oil and gas production, crude oil gathering and transportation, and refining processes. The total cyanide content in oily sludge leachates is an index used for the determination of the hazardous properties of oily sludges and their different treatment degrees. The most common methods used in the laboratory are silver nitrate titration and isonicotinic acid‐pyrazolone colorimetry. In this study, we used the silver nitrate titration method to determine the total cyanide content in oily sludge. The weighing and pretreatment of the oily sludge samples, preparation of the leach liquor, and determination of the total cyanide content are sufficiently presented to carry out repeated experiments. The concentration of the calibration reagent and addition can be determined experimentally. In the case of a high value of total cyanide, an increase in the amount of NaOH solution can improve the analysis results. This experiment is exploratory and can be helpful to some extent for students majoring in environmental engineering in understanding the dangerous properties of oily sludge, the methodology of toxicological analysis, and the protection theory of the leaching liquid. Furthermore, it can help students improve their experimental, analytical, and innovation abilities.