Particle-attached (PA) and free-living (FL) bacterial communities are essential for nutrient cycles and metabolite production and serve as a food source in aquatic systems. However, our understanding of how biotic factors influence community interactions, co-occurrence patterns, and niche occupancy remains limited. This study investigated the influence of protoporphyrin IX (PPIX) on bacteria with different lifestyles during Prorocentrum donghaiense bloom. The findings revealed that PPIX distribution responded variably to changes in physicochemical parameters induced by red tide bloom. Large-sized or particle-attached (PA) phytoplankton (cell size >3 μm) were identified as the primary contributors to environmental PPIX, while small-sized plankton or free-living (FL) microorganisms (<3 μm) contributed less. In red tide-affected areas, PPIX and its derivatives were significantly more abundant than in non-red tide areas, indicating an increased demand for porphyrins by plankton during red tides. Additionally, the red tide also significantly influenced the preference of bacterial lineages for PA or FL lifestyles, highlighting a close interaction between bacteria with different lifestyles and PPIX levels. This study quantitatively analyzed the distribution of PPIX across different cell sizes in red tide and non-red tide marine environments, providing insights into microbial interactions and dynamics in changing ecosystems and offering a reference for using PPIX to predict red tide ecological disasters.