Piezoelectric materials, which respond mechanically to applied electric field and vice versa, are essential for electromechanical transducers. Previous theoretical analyses have shown that high piezoelectricity in perovskite oxides is associated with a flat thermodynamic energy landscape connecting two or more ferroelectric phases. Here, guided by phenomenological theories and phase-field simulations, we propose an alternative design strategy to commonly used morphotropic phase boundaries to further flatten the energy landscape, by judiciously introducing local structural heterogeneity to manipulate interfacial energies (that is, extra interaction energies, such as electrostatic and elastic energies associated with the interfaces). To validate this, we synthesize rare-earth-doped Pb(Mg1/3Nb2/3)O3-PbTiO3 (PMN-PT), as rare-earth dopants tend to change the local structure of Pb-based perovskite ferroelectrics. We achieve ultrahigh piezoelectric coefficients d33 of up to 1,500 pC N-1 and dielectric permittivity ε33/ε0 above 13,000 in a Sm-doped PMN-PT ceramic with a Curie temperature of 89 °C. Our research provides a new paradigm for designing material properties through engineering local structural heterogeneity, expected to benefit a wide range of functional materials.