A fast and facile route for the optimization of covalent triazine frameworks (CTFs) for photocatalytic hydrogen production is presented. Within 10 minutes a CTF with low photocatalytic activity can be converted into a highly active photocatalyst. Optimized CTF catalysts show an average hydrogen evolution rate of 1072 μmol h-1 g-1 under visible light (>420 nm).