Mesoporous LaFeO3/g-C3N4 Z-scheme heterojunctions (LFC) were synthesized via the incorporation of LaFeO3 nanoparticles and porous g-C3N4 ultrathin nanosheets. The as prepared LFC were characterized by transmission electron microscopy, scanning electron microscopy, atomic force microscopy, X-ray photoelectron spectroscopy, powder X-ray diffraction, Raman spectra and N2 adsorption analysis. The structural analysis indicated that the reheating process and the addition of NH4Cl in the thermal polymerization were the key factors to get porous g-C3N4 ultrathin nanosheets and to obtain high specific surface areas of LFC. It remarkably enhanced the adsorption capacity and photocatalytic degradation of LFC for removal of oxytetracycline (OTC). The effect of the mass percentage of LaFeO3 in LFC, pH and temperature on the OTC adsorption was investigated. The LaFeO3/g-C3N4 heterojunction with 2 wt % LaFeO3 (2-LFC) exhibited highest saturated adsorption capacity (101.67 mg g−1) and largest photocatalytic degradation rate constant (1.35 L g−1 min−1), which was about 9 and 5 times higher than that of bulk g-C3N4 (CN), respectively. This work provided a facile method to prepare mesoporous LaFeO3/g-C3N4 heterojunctions with especially well adsorption and photocatalytic activities for OTC, which can facilitate its practical applications in pollution control.