ABSTRACT We present a physically motivated model for the manner in which a stellar magnetic field sculpts the inner edge of a protoplanetary disc, and examines the consequence for the migration and stopping of sub-Neptune and super-Earth planets. This model incorporates a transition zone exterior to the inner truncation of the disc, where the surface density profile is modified by the diffusion of the stellar magnetic field into the disc. This modification results in a migration trap at the outer edge of the transition zone. We performed simulations of single-planet migration, considering a range of stellar magnetic field strengths and magnetic diffusion profiles. Our simulations show a tight relationship between the final locations of planets and the total magnetic budget available for the disc from their host star. We found that a stellar magnetic field between 67 and 180 G and a power-law index between 3 and 2.75 can reasonably reproduce the location at which the observed occurrence rate of close-in super-Earth and sub-Neptune populations changes slope.