As the overuse of antibiotics increasingly contaminates the environment, one of modern chemistry's objectives is to identify high-performance photocatalytic materials to degrade antibiotics. This study initially utilized NH4Cl as a gas template to synthesize porous lamellar g-C3N4 (CNS) through a high-temperature calcination process. Building upon this, a homojunction catalyst, CNS/g-C3N5 (S-CN), was developed via a secondary sintering technique using different amount of 3-amino-1,2,4-triazole addition to evaluate its efficacy in activating peroxymonosulfate (PMS) for degrading the antibiotic ceftriaxone sodium. Under neutral conditions, the photocatalytic system composed of S-CN catalysts prepared by 50 mg of 3-amino-1,2,4-triazole addition and PMS (S3-CN/PMS) exhibited degradation rates that were 3.37 and 8.11 times higher than those of the CNS/PMS and g-C3N5/PMS, respectively. At a pH of 8, the S3-CN/PMS system attained a 99.7 % degradation efficiency within 75 min. Based on results from UV–visible diffuse reflectance spectroscopy (DRS), transient photocurrent response, electrochemical impedance spectroscopy (EIS), photoluminescence spectroscopy and radical scavenging experiments, this high efficiency is attributed to a homojunction Z-type charge transfer mechanism that enhances the separation of photogenerated carriers. Furthermore, the study found that the optimal PMS addition was 20 mg and the optimal pH was 8. Chloride ions promoted the reaction, while other ions decreased the reaction rate. In conclusion, this paper provides valuable insights for the morphological modification of carbon nitride homojunction materials and the efficient activation of PMS for pollutant degradation.