Bacterial infection is one of the leading causes of death worldwide and is easy to cause large-scale diseases. It is an urgent need to develop effective methods for the specific detection and treatment of bacterial infections. Recently, small molecular fluorescent probes, bridging the capability of imaging detection and sterilization, have attracted increasing attention. Fluorescence imaging assays have the benefit of being simple, specific, and fast, which is very advantageous in both in vitro and in vivo bacterial detection. Molecularly fluorophores for theranostics provide advantages of non-invasion, high specificity, and fewer side effects. In this review, we summarize the recent advances and design strategies of small molecular fluorescent probes for both targeted detection and treatment of bacteria. We hope that this review will provide guidance for the development of more effective fluorescent dyes in the future as well as encourage preclinical and clinical studies of phototherapymediated antimicrobial therapy.