LiTi₂(PO₄)₃ (LTP) and related materials based on the structure of NaZr₂(PO₄)₃ (NZP) belong to a family of Li ion conducting compounds for applications in Li ion batteries. Because of their three-dimensional framework of TiO₆ octahedra and PO₄ tetrahedra, which provide several positions for mobile charge carriers, and the large number of possible compounds crystallizing in this type of structure, they are promising ion conducting materials. In this work, we investigate the migration barriers for an interstitial Li ion and a Li vacancy in the rhombohedral structure of these compounds using density functional theory. Our results show that the substitution of Ti atoms in LTP by a variety of tri-, tetra-, and pentavalent cations X (LXTP) leads to structural changes influencing the Li mobility. The calculated activation energies for migrating vacancies vary between 0.29 and 0.75 eV and are related to the sizes of LiO₆ octahedra in the structure. For migrating interstitials in bulk LTP, the calculated activation energy of about 0.19 eV is much lower. However, substitution by trivalent ions like Al introduces interstitial Li ions for charge compensation, but these additional Li ions get trapped near the trivalent ions.