Synthesis of three-dimensional photocatalysts offers great potential for chemical conversion and hydrogen generation as appropriate solutions for environmental protection and energy shortage challenges. In this study, the magnetic WO 3−x @ mesoporous carbon (M-WO 3−x @MC) was synthesized through the evaporation-induced self-assembly method applying diatom frustules as a natural template. Then, plasma modification was used to prepare the N-doped M-WO 3−x @MC (NM-WO 3−x @MC) with enhanced photocatalytic activity and durable performance. The WO 3−x was embedded in the conductive MC, which was also partially reduced by the carbon precursor within the heat-treatment procedure. The obtained M-WO 3−x @MC was treated by the plasma under an N 2 atmosphere for the production of the final photocatalyst containing both the N-doped WO 3−x and MC. As a result, the NM-WO 3−x @MC had larger surface area (208.4 m 2 g −1 ), narrower band gap (2.3 eV), more visible light harvesting, and confined electron−hole pairs recombination. The H 2 generation rates of net WO 3 nanorods and NM-WO 3−x @MC nanocomposite were estimated as 532 and 2765 μmol g −1 h −1 , respectively. Additionally, more than 90% of antibiotics (cephalexin, cefazolin and cephradine) degradation and 76% of total organic carbon elimination were obtained after 120 and 240 min of photocatalytic process under visible light irradiation. Eventually, more than eight intermediates were detected for each antibiotic degradation using the gas chromatography−mass spectrometer method, and based on the obtained results, the possible degradation pathways were suggested.