The very first criteria for the permanent magnetic material design is crystal structure which allows magnetic moments to align along the anisotropic crystal axis. Hexagonal and tetragonal structures do fall within this category. The involved crystal sites play a key role in determining the magnetic moments and uniaxial magnetic anisotropy. Here we present how advanced density functional calculations incorporating electron correlation and spin orbit coupling are capable to predict and optimize magnetic anisotropy contributed by the rare-earth sites due to the crystal-field split and spin-orbit coupled 4f-states followed by the small but non-negligible magnetic anisotropy contributed by 3d-states. We focus on the site substituted SmCo5 and it’s derivatives to show how theory helps to design and tailor intrinsic properties of permanent magnetic materials.