Optical imaging of microbial infections, based on the detection of targeted fluorescent probes, offers high sensitivity and resolution with a relatively simple and portable setup. As the absorbance of near-infrared (NIR) light by human tissues is minimal, using respective tracers, such as IRdye800CW, enables imaging deeper target sites in the body. Herein, we present a general strategy for the conjugation of IRdye800CW and IRdye700DX to small molecules (vancomycin and amphotericin B) to provide conjugates targeted toward bacterial and fungal infections for optical imaging and photodynamic therapy. In particular, we present how the use of coupling agents (such as HBTU or HATU) leads to high yields (over 50%) in the reactions of amines and IRDye-NHS esters and how precipitation can be used as a convenient purification strategy to remove excess of the targeting molecule after the reaction. The high selectivity of the synthesized model compound Vanco-800CW has been proven in vitro, and the development of analogous agents opens up new possibilities for diagnostic and theranostic purposes. In times of increasing microbial resistance, this research gives us access to a platform of new fluorescent tracers for the imaging of infections, enabling early diagnosis and respective treatment.