Posidonia oceanica (L.) Delile meadows are highly productive coastal marine ecosystems that provide multiple ecosystem services. The seagrass is not always the major contributor to total primary production, however, little is known about long-term changes in the composition of primary producers within seagrass meadows. Understanding compositional shifts within the community of primary producers is crucial to evaluate how climate and anthropogenic change affect the functioning of seagrass ecosystems. Here we analysed marker pigment composition in seagrass cores from two bays of the Cabrera Island (Balearic Islands, Spain) to asses long-term changes in phototrophic community composition and production in seagrass meadows, and identify the environmental factors triggering those changes. The proxy dataset was explored using principal component analyses (PCA): one including the pigment dataset to look for associations between producers' groups, and another one combining the pigment dataset with plausible local and global regulatory factors to assess the environmental drivers of change. Analyses of characteristic pigments and morphological fossils (cysts) showed that the abundance of dinoflagellates increased over the last 150–300 years, coeval with a rise in solar irradiance and air temperature. When compared among embayments, pigments from cyanobacteria predominated in seagrass meadows located at Es Port, a sheltered bay receiving higher terrestrial runoff; whereas pigments from diatoms, seagrasses and rodophytes were more common at Santa Maria, an exposed bay with clearer waters. Water depth also played a role in controlling the phototrophic community composition, with greater abundance of diatoms in the shallowest waters (<5 m). Overall, our results suggested that historical and spatial variation in seagrass meadows' phototrophic community composition was influenced by the interaction between local factors (catchment-bay characteristics) and global climate processes (energy influx). Together these patterns forecast how marine primary producers and seagrass ecosystem structure may respond to future global warming.