Herein, we report the efficient preparation of π-electron-extended triazine-based covalent organic framework (TFP-TPTPh COF) for photocatalysis and adsorption of the rhodamine B (RhB) dye molecule, as well as for photocatalytic hydrogen generation from water. The resultant TFP-TPTPh COF exhibited remarkable porosity, excellent crystallinity, high surface area of 724 m2 g−1, and massive thermal stability with a char yield of 63.41%. The TFP-TPTPh COF demonstrated an excellent removal efficiency of RhB from water in 60 min when used as an adsorbent, and its maximum adsorption capacity (Qm) of 480 mg g−1 is among the highest Qm values for porous polymers ever to be recorded. In addition, the TFP-TPTPh COF showed a remarkable photocatalytic degradation of RhB dye molecules with a reaction rate constant of 4.1 × 10−2 min−1 and an efficiency of 97.02% under ultraviolet–visible light irradiation. Furthermore, without additional co-catalysts, the TFP-TPTPh COF displayed an excellent photocatalytic capacity for reducing water to generate H2 with a hydrogen evolution rate (HER) of 2712 μmol g−1 h−1. This highly active COF-based photocatalyst appears to be a useful material for dye removal from water, as well as solar energy processing and conversion.