Electrocatalytic promotion of water splitting is considered an effective way to obtain hydrogen, but it is limited by the expensive nature and scarcity of effective catalysts currently available. Due to their stability, efficient characteristics, and high activity, transition metal phosphides have attracted extensive attention from researchers in electrocatalysis. In this study, the effect of doping with group VIII elements on the hydrogen evolution reaction (HER) activity of CoP (011) was investigated using first-principles calculations based on density functional theory. More active sites were exposed by doping with Rh, Ir, Ni, Pd, and Pt atoms, which significantly improved the catalytic activity of CoP (011) for the HER. It has also been verified by the analysis of the crystal orbital Hamilton population and d-band centers, which indicated the electronic properties resulting in the HER activity improvement. Hydroxylation usually occurs on surfaces lacking coordination in a solution environment, influencing the active sites. Calculations show that adopting suitable transition-element doping can reduce the hydroxyl coverage on the (011) surface of cobalt phosphide and thus improve the HER efficiency. Since surface oxidation is inevitable in the oxygen evolution reaction (OER) process, one case was assumed that all Co atoms in the typical CoP (011) facet were oxidized to form CoOOH, which was studied to explore the mechanism of OER activity. The results indicated that surface oxidation could reduce the OER overpotential, which was the key for CoP to achieve a high-efficiency OER. The theoretical investigations presented that the substitution doping of Fe, Rh, and Ir activated the Co atom adjacent to the dopant atom, which significantly improved performance by adjusting the electronic structure. This theoretical investigation helps to understand the effects of doping and surface oxidation on the electrocatalytic activity of phosphides, and this provides a theoretical perspective basis for the design of transition metal-doped catalysts for overall water splitting.