Piezo-photocatalytic nitrogen hydrogenation is one of the most promising technologies for directly producing ammonia from nitrogen. However, it is often challenged by the catalyst with special morphology or ultraviolet-responded oxides. Here, a novel kind of piezo-photocatalyst embedded benzene-1,4-dicarboxylic acid dihydrazide unit in poly(heptazine imide) (DKCN) was successfully produced by co-polymerization method. Exhaustive experimental and simulation research certified that the linkage and D-A unit redistributed the distribution of charge center and band gap as well as acted as the center of stress, which enhanced the light absorption in near-infrared light, the in-plane polarization of poly(heptazine imide) and provided active site. Besides, the piezoelectric effect further offers electric field under ultrasound to polarize the charge and promote the directional migration of carriers. Therefore, in the absence of co-catalysts and sacrificial agents, DKCN exhibits good performance in the piezo-photocatalytic reduction of N2 to NH3 in pure water (183.3 μmol g−1 h−1), which reached 21.6 times than the original carbon nitride. This work offers a promising and sustainable route for the design of piezo-photocatalytic materials.