Eliminating hazardous antibiotics from aquatic environments has become a major concern in recent years. Tetracycline (TC) compounds pose a challenge for the selective degradation of harmful chemical groups. In this study, we successfully designed carbon vacancies in a gC3N4@WC (GW) heterostructure for the effective removal of TC pollutants under visible light. The carbon vacancies in the GW heterostructure were confirmed using X-ray photoelectron spectroscopy and electron spin resonance spectroscopy (ESR). The introduction of defects into the as-prepared GW heterostructure significantly impacted the photocatalytic performance of the catalyst. Moreover, defect formation results in enhanced light utilization, a large surface area, and the exposure of numerous active sites, thereby improving the redox capability and facilitating the efficiency of charge carriers during the photocatalytic degradation of TC. The photoluminescence and electrochemical analysis revealed that the GW3 heterostructure has a low recombination rate of photogenerated electron-hole pairs, which enhances the consumption of visible light. The as-prepared GW3 catalyst exhibits the highest degradation efficiency and kinetic rate constants of 92.73% and 0.0218 min-1 within 120 min, respectively. ESR and radical trapping experiments confirmed that ˙O2- radicals were the primary active species associated with the remarkable TC photodegradation activity. The degradation mechanism and intermediate reaction pathways of TC were investigated using density functional theory and liquid chromatography-mass spectroscopy studies. An in vivo model of C. elegans was used to investigate the toxicological effects of TC degradation. Therefore, this study proposes a method for the construction of dynamic and pioneering semiconductor catalysts to eliminate organic pollutants via photocatalysis.