The nitrogen (N) and phosphorus (P) addition promotes the abundance of soybean soil nematodes. • The addition of nitrogen can alleviate the suppression of phosphorus on nematodes.• Phosphorus addition affects nematode abundance by ammonium nitrogen. With global warming, the increasing of industrial and agricultural activities and demand for fossil fuels, large amounts of nitrogen and phosphorus compounds are released into the atmosphere, resulting in an annual increase in nitrogen and phosphorus deposition. The nematodes, as one of the main functional groups of soil organisms, occupy multiple trophic levels in soil detritus food networks. However, few studies on the effects of nitrogen and phosphorus on soil nematodes, and the results are uncertain. This experiment was conducted in soybean farmland and four treatments included control, nitrogen addition, phosphorus addition, and N + P addition. The results showed that both phosphorus and N + P addition significantly increased the abundance of soil nematodes, but that had no effects on soil nematodes richness. Redundancy analysis showed that nitrate nitrogen, soil moisture content, and pH were environmental factors driving different dietary changes in soil nematode communities. The effect of phosphorus addition on the abundance of nematode communities mainly affects ammonium nitrogen. Our findings revealed that nitrogen addition when phosphate fertilizer is added to soybean farmland will have a certain positive effect on the soil underground food web, which provides a basis for better explaining the effect of nitrogen and phosphorus addition on soybean farmland.