Hydrogels are known to have the advantages such as good biodegradability, biocompatibility, and easy functionalization, making them ideal candidates for biosensors. Hydrogel‐based biosensors that respond to bacteria‐induced microenvironmental changes such as pH, enzymes, antigens, etc., or directly interact with bacterial surface receptors, can be applied for early diagnosis of bacterial infections, providing information for timely treatment while avoiding antibiotic abuse. Furthermore, hydrogel biosensors capable of both bacteria diagnosis and treatment will greatly facilitate the development of point‐of‐care monitoring of bacterial infections. In this review, the recent advancement of hydrogel‐based biosensors for bacterial infection is summarized and discussed. First, the biosensors based on pH‐sensitive hydrogels, bacterial‐specific secretions‐sensitive hydrogels, and hydrogels directly in contact with bacterial surfaces are presented. Next, hydrogel biosensors capable of detecting bacterial infection in the early stage followed by immediate on‐demand treatment are discussed. Finally, the challenges and future development of hydrogel biosensors for bacterial infections are proposed.