Electrosorption is a technique that combines electrical and adsorption processes and has been established to displace Th(IV) from aqueous solutions. The present study successfully synthesised a novel electrode, where graphitic carbon nitride was modified with amidoxime amidoxime groups (g-C3N4/AX) via the hydrothermal method. The batch experiments conducted in this study revealed that the g-C3N4/AX electrode possessed a favourable thorium adsorption capacity of 275.74 mg.g−1 and a swift elimination equilibrium of within 30 min. Furthermore, the removal efficiency at − 1.0 V (84.46 %) of the electrode was almost threefold greater than the removal efficiency at open circuit potential (24.09 %). The results were due to the free electrical charges on the g-C3N4/AX electrode, which induced the electrical driving force and facilitated the adsorption of Th(IV) ions onto the g-C3N4/AX surface. The shifted bands from the Fourier transform-infrared (FT-IR) spectrum post-electrosorption demonstrated a substantial complexation of Th(IV) with the amine groups of amidoxime and g-C3N4. A significant transference in energy band peaks was also observed during the XPS assessment, indicating that the electrosorption process included oxygen (O), carbon (C), and nitrogen (N) species. In the practical real wastewater involving rare earth residue, which contains Ce, La, Nd and Pr ions, g-C3N4/AX exhibited good capabilities in selectively adsorbing Th(IV). The electrode synthesised in this study also exhibited the ability to regenerate with a reasonable ∼ 80 % removal ratio after five runs. The results indicated that the amidoxime-modified graphitic carbon nitride electrode demonstrated a good potential in removing thorium from aqueous solutions via electrosorption applications.