Cells living in geometrically confined microenvironments are ubiquitous in various physiological processes, e.g., wound closure. However, it remains unclear whether and how spatially geometric constraints on host cells regulate bacteria-host interactions. Here, we reveal that interactions between bacteria and spatially constrained cell monolayers exhibit strong spatial heterogeneity, and that bacteria tend to adhere to these cells near the outer edges of confined monolayers. The bacterial adhesion force near the edges of the micropatterned monolayers is up to 75 nN, which is ~3 times higher than that at the centers, depending on the underlying substrate rigidities. Single-cell RNA sequencing experiments indicate that spatially heterogeneous expression of collagen IV with significant edge effects is responsible for the location-dependent bacterial adhesion. Finally, we show that collagen IV inhibitors can potentially be utilized as adjuvants to reduce bacterial adhesion and thus markedly enhance the efficacy of antibiotics, as demonstrated in animal experiments.