Using a microscopic model and Green’s function theory, we calculated the magnetization and band-gap energy in ion-doped LiMPO4 (LMPO), where M = Fe, Ni, Co, Mn. Ion doping, such as with Nb, Ti, or Al ions at the Li site, induces weak ferromagnetism in LiFePO4. Substituting Li with ions of a smaller radius, such as Nb, Ti, or Al, creates compressive strain, resulting in increased exchange interaction constants and a decreased band-gap energy, Eg, in the doped material. Notably, Nb ion doping at the Fe site leads to a more pronounced decrease in Eg compared to doping at the Li site, potentially enhancing conductivity. Similar trends in Eg reduction are observed across other LMPO4 compounds. Conversely, substituting ions with a larger ionic radius than Fe, such as Zn and Cd, causes an increase in Eg.