In this work, ultrasmall gold nanoclusters (AuNCs) have been in situ synthesized in nanopores of covalent organic framework (COF) nanoparticles, which exhibited enhanced fluorescence, improved photosensitizing capabilities, and promising antibacterial performance. A small organic molecule, 1-vinylimidazole (Vim), was diffused into the nanopores of imine-based COFs and served as a reducing agent and capping ligand for the in situ synthesis of ultrasmall AuNCs. The as-obtained AuNCs were homogeneously distributed throughout the COF nanoparticles whose fluorescence intensity was enhanced remarkably. Due to the efficient electron transfer between AuNCs and COFs and increased separation of photogenerated electron−hole pairs, the light-triggered reactive oxygen species (ROS) production of COFs was prominently enhanced by AuNCs. Moreover, the obtained nanocomposites exhibited an efficient photodynamic killing behavior on Escherichia coli under visible light exposure. Thus, we provide a facile strategy to prepare COF/AuNC nanocomposites for ROS-related applications.