Exploration of effective ways to integrate various functional species into hydrogen‐bonded organic frameworks (HOFs) is critically important for their applications but highly challenging. In this study, according to the “bottle‐around‐ship” strategy, core–shell heterostructure of upconversion nanoparticles (UCNPs) and HOFs was fabricated for the first time via a ligand‐grafting stepwise method. The UCNPs “core” can effectively upconvert near‐infrared (NIR) irradiation (980 nm) into visible light (540 nm and 653 nm), which further excites the perylenediimide‐based HOF “shell” through resonance energy transfer. In this way, the nanocomposite inherits the high porosity, excellent photothermal and photodynamic efficiency, NIR photoresponse from two parent materials, achieving intriguing NIR‐responsive bacterial inhibition toward Escherichia coli. This study may shed light on the design of functional HOF‐based composite materials, not only enriching the HOF library but also broadening the horizon of their potential applications.