context: Zero-valent nonmetal engineering can also be extended to P-regulated metal nitrides and carbides. Fu et al. selected small-sized tungsten nitride (WN; ∼3 nm) as the model to investigate the function of P dopants. The experimental results confirmed that P modification could lead to significant enhancements in catalytic activity and stability for HER in acidic media, particularly with low onset overpotential of 46 mV, Tafel slope of 54 mV dec−1, large exchange current density of 0.35 mA cm−2, and long-term stability. The enhanced performance could be attributed to the interaction of P with WN, which can increase the work function. Different from the earlier reported uncontrolled P-doping strategy, Tang et al. fabricated hierarchical nanowires comprising P-doped MoC2 nanoparticles via the controlled carbonization of ternary organic–inorganic (MoOx–phytic acid–polyaniline) nanohybrids. A series of samples with different contents of P in the range of 0–3.4 wt% were successfully prepared by varying the introduced amount of polyaniline. With an increase in the P content, the XPS peaks for Mo 3d shifted to lower binding energies, signifying that the electron density of Mo2+ in MoC2 was enriched by doping P. In addition, P doping could enrich the electrons around the Fermi level in MoC2, resulting in weakened Mo–H and promoted Hads desorption in HER kinetics. Combining optimal Hads desorption energy on Mo2C and hierarchical structure, the P–Mo2C@C nanowires with controlled P doping delivered benchmark HER activity and good stability in acidic electrolytes.