In this work, we studied the application of photovoltaic solar energy for driving the electrochemical processes of electrocoagulation and electrooxidation to remediate drilling fluid wastewater, and simultaneously harvest energy in the form of electrolytic hydrogen gas produced at the cathode. The electrocoagulation was performed with sacrificial aluminium electrodes and electrooxidation with dimensionally stable boron-doped diamond electrodes in batch-wise and continuously operated mode, and their efficiency in both pollutants removal and hydrogen gas production was elucidated. The parameters affecting the efficiency of the applied electrochemical processes, such as applied current density, pH, electroprocessing time and flow rate, were investigated. The electrochemical processing was monitored by measuring the chemical oxygen demand (COD) of treated wastewater. The electrocoagulation treatment conducted with current densities of 30, 60 and 90 mA/cm2 reduced the wastewater COD by about 67%, whereas the electrooxidation treatment at the same conditions yielded a COD removal of over 95%. The amount of produced hydrogen was 171 L/g COD removed from treated wastewater.