Agri-environment schemes (AES) compensate farmers for land use measures that are costly to them but beneficial to biodiversity and the environment. We present an ecological-economic modeling procedure for the design of cost-effective AES to conserve grassland biodiversity, which is applicable to large areas, covers many endangered species and grassland types, and includes several hundred different types of mowing regimes, grazing regimes, and combinations of mowing and grazing regimes as land use measures. The modeling procedure also accounts for the spatial variations in the land use measures' costs and in the effects on species and grassland types. The procedure's main novelty is that it considers variations of the costs and impacts on species and grassland types that arise from different timings of the land use measures. Considering the spatial and the temporal dimension of land use measures makes the modeling procedure spatiotemporally explicit. We demonstrate the power of the modeling procedure by evaluating an existing grassland AES in Saxony, Germany, and identify substantial improvements in terms of cost-effectiveness.