Fresh groundwater in arid and highly populated regions is limited. In coastal aquifers, the deterioration of fresh groundwater is accelerated by saltwater intrusion, primarily occurring through lateral encroachment and vertical movements in the proximity of discharging wells. Coastal regions have high salinity due to saline intrusion, where many abstraction wells are turned off by this high salinity, which leads to increased freshwater supply costs. This study investigates the performance of new approach using the shoreline subsurface dams (SSDs) for mitigating the saline water wedge in coastal aquifers, where the dams are installed at the shoreline (distance from shoreline = 0). Specifically, the current study's novelty is testing the effectiveness of SSDs by different relative heights ranging from 0.05 to 0.50 in the test case (Henry problem) and from 0.09 to 0.53 relative to the aquifer thickness in the field scale aquifer (Biscayne aquifer, Florida, USA). The results showed an exponential increase in salt repulsion for increasing SSDs height, reaching a maximum of + 0.70%, + 1.80%, + 3.25%, + 5.80%, + 10.45%, and + 18.40% for the dam height to aquifer thickness ratios of 0.09, 0.18, 0.26, 0.35, 0.44 and 0.53, respectively, in the field scale case. The SSDs increase the freshwater storage at the coastal zones where the low salinity occurs and reduces the freshwater supply cost. Despite the positive impact of height on repulsion, important factors such as economics, construction aspects, geographical suitability, and environmental impacts must be considered for real applications. This is crucial to develop feasible solutions applicable globally under the growing pressure of sea level rise.