Biofilms are structured communities of microbial cells embedded in a self-produced matrix of extracellular polymeric substances. Biofilms are associated with many health issues in humans, including chronic wound infections and tooth decay. Current antimicrobials are often incapable of disrupting the polymeric biofilm matrix and reaching the bacteria within. Alternative approaches are needed. Here, we describe a unique structure of dextran coated gold in a gold cage nanoparticle that enables photoacoustic and photothermal properties for biofilm detection and treatment. Activation of these nanoparticles with a near infrared laser can selectively detect and kill biofilm bacteria with precise spatial control and in a short timeframe. We observe a strong biocidal effect against both Streptococcus mutans and Staphylococcus aureus biofilms in mouse models of oral plaque and wound infections respectively. These effects were over 100 times greater than that seen with chlorhexidine, a conventional antimicrobial agent. Moreover, this approach did not adversely affect surrounding tissues. We conclude that photothermal ablation using theranostic nanoparticles is a rapid, precise, and non-toxic method to detect and treat biofilm-associated infections.