The growing demand for environmental protection and sustainable food production requires the efficient use of organic and slow‐release fertilizers in agriculture. In this study, co‐composting of municipal solid waste (MSW) + three different ratios of natural and Mg‐modified zeolites (5, 10, and 15% on a wet weight basis) is conducted to improve the MSW compost quality. The effects of soil amendment with MSW compost containing natural zeolite (CNZ) and Mg‐modified zeolite (CMZ) on the corn yield, moisture content, leaching volumes, and NO3‐N concentrations are investigated. Compared to the control (zeolite‐free compost), the CNZ15 and CMZ15 treatments show 39.9 and 49.3% reduction in electrical conductivity and an increase of 64.5 and 110% in NH4‐N retention, respectively. By using the composts containing zeolite, the moisture content in the surface layer of soil is increased up to 12.6%. Nitrogen uptake and water use efficiency in the CNZ treatment are enhanced by 34.6 and 40.0%, respectively. The increase of the nitrogen uptake and water use efficiency of the CMZ treatment is 54.5 and 55.6%, respectively. Compared to the control, the amount of total NO3‐N leached from CNZ and CMZ treatments is decreased by 21.0 and 28.9%, respectively. The use of the MSW compost modified with Mg‐zeolite is, therefore, an environmentally friendly solution to prevent surface and groundwater pollution. The modified compost could be also used for the improvement of the physicochemical properties of sandy loam soils.