The current viral pandemic has highlighted the compelling need for effective and versatile treatments, that can be quickly tuned to tackle new threats, and are robust against mutations. Development of such treatments is made even more urgent in view of the decreasing effectiveness of current antibiotics, that makes microbial infections the next emerging global threat. Photodynamic effect is one such method. It relies on physical processes proceeding from excited states of particular organic molecules, called photosensitizers, generated upon absorption of visible or near infrared light. The excited states of these molecules, tailored to undergo efficient intersystem crossing, interact with molecular oxygen and generate short lived reactive oxygen species (ROS), mostly singlet oxygen. These species are highly cytotoxic through non-specific oxidation reactions and constitute the basis of the treatment. In spite of the apparent simplicity of the principle, the method still has to face important challenges. For instance, the short lifetime of ROS means that the photosensitizer must reach the target within a few tens nanometers, which requires proper molecular engineering at the nanoscale level. Photoactive nanostructures thus engineered should ideally comprise a functionality that turns the system into a theranostic means, for instance, through introduction of fluorophores suitable for nanoscopy. We discuss the principles of the method and the current molecular strategies that have been and still are being explored in antimicrobial and antiviral photodynamic treatment.