We use state-of-the-art ab initio calculations based on the generalized gradient approximation of the density functional theory in the planar augmented wavefunction formalism to determine the elastic constants tensor of perovskite and post-perovskite with formulas AlFeO3 and FeAlO3 in which Fe or Al respectively occupy only octahedral sites, for the stable magnetic configurations. The phase transition between perovskite and post-perovskite is associated with a site exchange, during which Fe from the inter-octahedral site in perovskite moves into the octahedral site in post-perovskite. Following this transition path the elastic moduli show positive jumps, considerably larger than for MgSiO3. The phase transition is marked by a positive jump of 0.04 km/s (0.33%) in the velocity of the compressional waves and by a negative jump of −0.15 km/s (−1.87%) in shear wave velocity. We find that the effects of the Mg + Si <=> Al + Fe substitution on the seismic properties of MgSiO3 perovskite and post-perovskite depend on the crystallography of the substitution, namely the position the exchanged cations take in the structure.