Infection is a major prompt of chronic wounds, increasing the pH on the injury tissues. Thus, pH can be used as trigger for antimicrobial agents’ delivery, preventing chronic wounds. Hence, the present work aimed to develop a hydrogel with drug delivery capacity, modulated by environmental pH. Chitosan was used as electrolyte monomer and it was crosslinked with hydroxypropyl methylcellulose and 2‐hydroxypropyl‐β‐cyclodextrin. The polymeric network assembly was confirmed by FTIR and thermal analysis. The developed hydrogels behaved as superabsorbent systems, with higher swelling at pH 7. Caffeic acid loading was ruled by the inclusion complex formation between the phenolic acid and cyclodextrin. Chitosan hydrogels delivery capacity was pH‐dependent and, also, more efficient at pH 7. Based on the Peppas–Sahlin model, fickian diffusion was the main mechanism responsible for caffeic acid release. Based on the results, the developed hydrogel can be used to prevent wound infection, due to its ability to release antimicrobial agents when the wound pH rises.