Antibiotic misuse and bacterial resistance are pressing issues threatening public health. Natural plant extracts with bactericidal properties offer potential alternatives to reduce or replace antibiotic use. This study aims to develop a thermosensitive hydrogel containing daphnetin (DAP-TG) using poloxamers 407 (P407), polyvinylpyrrolidone (PVP), and poloxamers 188 (P188). We systematically evaluated the gel's antibacterial activity against Escherichia coli (E. coli) and Staphylococcus aureus (S. aureus), as well as its antibacterial mechanisms. By examining the gelation temperature and time, degradation time, and in vitro release performance of DAP-TG, we produced a sustained-release DAP-TG with a rapid phase transition at (31.6 ± 0.1) °C. Its structure was characterized through Fourier transform infrared (FTIR) spectroscopy and scanning electron microscopy (SEM). The results indicated that the DAP thermosensitive hydrogel was formed and presented a 3D network spatial structure. The biocompatibility of DAP-TG was explored through the hemolysis test and cytotoxicity test. The results indicated that DAP-TG possessed excellent biocompatibility. The antibacterial efficacy of DAP-TG against E. coli and S. aureus was assessed using minimum inhibitory concentration (MIC), minimum bactericidal concentration (MBC), growth curve, and inhibition zone tests. Results showed that DAP-TG exhibited excellent antibacterial activity against both E. coli and S. aureus, with MIC values of 1.28 and 0.32 mg/mL. The antibacterial mechanism of DAP-TG was preliminarily explored through the investigation of bacterial cell content leakage, AKP leakage, membrane permeability, SEM, ROS production, and biofilm inhibition activity. DAP-TG induced irreversible damage to the cell membranes of E. coli and S. aureus, resulting in enhanced permeability, elevated ROS levels, and inhibited biofilm formation. Our study indicates that DAP-TG exhibits effective sustained-release and antibacterial properties against E. coli and S. aureus in vitro, making it a promising candidate for antibacterial applications in food and pharmaceutical products.