Cut-off walls have proven to be an effective countermeasure for mitigating seawater intrusion (SI). However, construction of cut-off walls may lead to upstream accumulation of nitrate contaminants in coastal aquifers. While stratified geological heterogeneities are widely present in coastal areas, how they may influence nitrate enrichment induced by cut-off walls remains poorly understood. In the present study, we employ variable-density coupling with reactive transport numerical models to understand and quantify the dynamic changes of salinity and NO3− in layered heterogeneous coastal aquifers in the presence of cut-off walls. Our comprehensive simulation results indicate that aquifer heterogeneities are a primary factor in regulating nitrate accumulation. For example, the presence of a middle low-permeability layer between two high-permeability layers reduces the influence of cut-off wall height on SI if the bottom of the wall is placed inside the low-permeability layer. While the thickness of the middle low-permeability layer has a minor impact on SI, a thicker middle low-permeability layer leads significantly aggravated nitrate contamination. Moreover, our simulations reveal that the degree of nitrate accumulation changes non-monotonically with changes in the hydraulic conductivity of low-permeability layer—the total nitrate mass (TNM) first increases and then decreases as the hydraulic conductivity of the low-permeability layer increases. We also found that the impact of heterogeneities is a function of the location and depth of the cut-off wall. With the increases of the distance between wall and the ocean, the nitrate enrichment degree of nitrate pollution in the upstream aquifer decreases while seawater intrudes further in layered aquifer (i.e. case HLH). TNM increases as the wall depth increases, but the growth rates of TNM becomes lower when the bottom of the wall is placed inside the low-permeability layer. These quantitative analyses have critical implications for the planning and design of cut-off walls to effectively control SI while at the same mitigating nitrate pollution.