The United Nations (UN) has considered water a human right since 1977. However, freshwater available for consumption represents less than 1% of all water on Earth. Groundwater represents one of the largest reserves of drinking water and is susceptible to chemical contamination, especially from pollutants that seep into the soil, such as atrazine, bisphenol A, and tetracycline. These substances, along with Escherichia coli, were selected to simulate contamination in groundwater samples and evaluate the efficiency of electrochemical oxidation using boron‐doped diamond anodes and four different anion salts to analyze their impact on the treatment process. After electrolysis, the degradation of tetracycline, bisphenol A and atrazine was found to increase with decreasing current density, with average values of 77%, 96% and 100% at 15 mA cm−2 and 68%, 83% and 99% at 35 mA cm−2, respectively. Moreover, the mineralization of these substances showed the same behavior, decreasing from 67%, 64%, and 54% at 15 mA cm−2 to 52%, 35%, and 49% at 35 mA cm−2. The analysis of the results showed that the ions present in the solution significantly affect the degradation process and that they interact with the impurities used. For atrazine and tetracycline, the degradation efficiency followed the same pattern, < < < . However, in the case of bisphenol A and E. coli, phosphate showed better results, similar to nitrate. The high efficiency in eliminating bacteria, even at high concentrations, shows that the electrochemical treatment system has a strong bactericidal effect, eliminating bacterial colonies with up to 5 min of treatment.