The efficient deployment of visible and near-infrared (NIR) light for photocatalytic disinfection is of great concern a matter. Herein, we report a specific bifunctional 2D/2D g-C3N4/BiO2−x nanosheets heterojunction, prepared through a self-assembly approach. Delightfully, the obtained 2D/2D heterojunctions exhibited satisfactory photocatalytic disinfection performance towards Escherichia coli K-12 (E. coli K-12) under visible light irradiation, which was credited to the Z-scheme interfacial heterojunction facilitating the migration of photogenerated carries. The photoactivity enhancement driven by NIR light illumination was ascribed to the cooperative synergy effect of photothermal effect and “hot electrons”, engineering efficient charge transfer. Intriguingly, the carboxyl groups emerged on g-C3N4 nanosheets contributed a vital role in establishing the enhanced photocatalytic reaction. Moreover, the disinfection mechanism was systematically described. The cell membrane was destroyed, evidenced by the generation of lipid peroxidation reaction and loss of energy metabolism. Subsequently, the damage of defense enzymes and release of intracellular constituents announced the irreversible death of E. coli K-12. Interestingly enough, considerable microbial community shifts of surface water were observed after visible and NIR light exposure, highlighting the critical feature of disinfection process in shaping microbial communities. The authors believe that this work gives a fresh light on the feasibility of heterostructures-enabled disinfection processes.