From the viewpoint of controlling the visible-light-driven activities of catalysts containing metal nanoparticles (NPs) by tuning the microstructures of semiconducting supports, we employed a postsynthetic thermal modification approach to prepare carbon nitride (C3N4) species featuring different microstructures and then we synthesized Co and Ni NPs supported by these C3N4 species, which were used to catalyze the room-temperature H2 evolution from ammonia borane (NH3BH3). The systematic investigation showed that the catalysts had different activities under light irradiation. Compared with the pristine C3N4-based catalyst, all the modified C3N4-based catalysts had enhanced activities. The highest active Co catalyst with a total turnover frequency of 93.8 min-1 was successfully obtained, which exceeded the values of all the reported heterogeneous noble metal-free catalysts. The structure characterizations indicated that the postmodified porous C3N4 species had the different band structures, photoluminescence lifetime, and photocurrent density under visible light irradiation, leading to the different separation efficiency of photogenerated charge carriers. These characteristics helped us regulate the electronic characteristics of Co and Ni NPs in the supported catalysts and then led to the significantly different and enhanced activity in the visible-light-driven H2 evolution.