Context.Over the last two decades, a large population of close-in planets has been detected around a wide variety of host stars. Such exoplanets are likely to undergo planetary migration through magnetic and tidal interactions.Aims.We aim to follow the orbital evolution of a planet along the structural and rotational evolution of its host star, simultaneously taking into account tidal and magnetic torques, in order to explain some properties of the distribution of observed close-in planets.Methods.We rely on a numerical model of a coplanar circular star–planet system called ESPEM, which takes into account stellar structural changes, wind braking, and star–planet interactions. We browse the parameter space of the star–planet system configurations and assess the relative influence of magnetic and tidal torques on its secular evolution. We then synthesize star–planet populations and compare their distribution in orbital and stellar rotation periods toKeplersatellite data.Results.Magnetic and tidal interactions act together on planetary migration and stellar rotation. Furthermore, both interactions can dominate secular evolution depending on the initial configuration of the system and the evolutionary phase considered. Indeed, tidal effects tend to dominate for high stellar and planetary masses as well as low semi-major axis; they also govern the evolution of planets orbiting fast rotators while slower rotators evolve essentially through magnetic interactions. Moreover, three populations of star–planet systems emerge from the combined action of both kinds of interactions. First, systems undergoing negligible migration define an area of influence of star–planet interactions. For sufficiently large planetary magnetic fields, the magnetic torque determines the extension of this region. Next, planets close to fast rotators migrate efficiently during the pre-main sequence, which engenders a depleted region at low rotation and orbital periods. Then, the migration of planets close to slower rotators, which happens during the main sequence, may lead to a break in gyrochronology for high stellar and planetary masses. This also creates a region at high rotation periods and low orbital periods not populated by star–planet systems. We also find that star–planet interactions significantly impact the global distribution in orbital periods by depleting more planets for higher planetary masses and planetary magnetic fields. However, the global distribution in stellar rotation periods is marginally affected, as around 0.5% of G-type stars and 0.1% of K-type stars may spin up because of planetary engulfment. More precisely, star–planet magnetic interactions significantly affect the distribution of super-Earths around stars with a rotation period higher than around 5 days, which improves the agreement between synthetic populations and observations at orbital periods of less than 1 day. Tidal effects for their part shape the distribution of giant planets.