BiFeO3 as a p-type photocatalyst in BiFeO3-CdWO4 p-n heterojunction was modified by partial substitution of divalent Co2+ and Ni2+ at Fe-site to enhance the photocatalytic performance for H2 evolution from pure water splitting. At high impurity concentrations, XRD and Raman spectroscopy revealed a phase transition from rhombohedral to orthorhombic/tetragonal with higher crystal symmetry due to larger ionic radii of Co2+ and Ni2+ relative to that of Fe3+. The excess amount of impurities also resulted in the formation of nickel ferrite (NiFe2O4), cobalt ferrite (CoFe2O4), sillenite (Bi25FeO40) and mullite (Bi2Fe4O9) as secondary phases. The high resolution XPS spectra of O 1s and Fe 2p indicted that the concentration of oxygen vacancy and Fe2+: Fe3+ increased with doping BiFeO3, which is due to the structural distortion and defection. Moreover, magnetic property of BiFeO3 was promoted by Co and Ni doping so that the residual magnetization increased from 0.009 emu/g up to 0.061 and 0.068 emu/g by 9 mol.% doping of Ni and Co, respectively. The enhanced magnetism can be attributed to the net magnetic moment caused by different magnetic moment of Fe3+, Co2+ and Ni2+ as well as the structural defection that may be a reason for spin spiral suppression. Doping with Co and Ni led to reducing band gap energy, suppression of charge recombination, and increment of charge density and mobility. The efficiency of photocatalytic H2 evolution increased from 268.9 mu mol/h gcat by pure BFO up to 449.6 and 494.7 mu mol/h gcat by 9 mol.% Ni and Co doping, respectively.