In this study, a boron doped diamond (BDD) electrode (RSM2), fabricated at a boron carbon (B/C) ratio = 0.75%, a carbon hydrogen (C/H) ratio = 1.00%, and a reaction chamber pressure (P) = 5.00 torr, exhibited the best performance in terms of electrochemical degradation of guaifenesin [guaiacol glyceryl ether (GGE)] and total organic carbon (TOC) removal among 11 BDD electrodes prepared according to the response surface methodology (RSM). Associated with the B/C, C/H, and P parameters, BDD's diamond crystallite structure, graphite-sp(2) C, and grain size influenced the performance of the fabricated BDD electrodes. At 0.125 A cm(2) and 25 degrees C, the pseudo-first order reaction rate constants of the GGE and TOC removals were 0.33 and 0.031 min (1), respectively, and such removals were better in 0.5 M Na2SO4 than in real hospital wastewater. Both direct and indirect oxidation of GGE occurred during electrolysis. Solution pH affected the indirect oxidation of GGE by center dot OH, SO4 center dot , or persulfate electrochemically generated during electrolysis. Several intermediates, including guaiacol, quinones, (aromatic and aliphatic) acids, and hexane-2,5-dione were detected and used to picture the GGE degradation pathways. (C) 2021 Taiwan Institute of Chemical Engineers. Published by Elsevier B.V. All rights reserved.