Pyridine-type alkaloids are most common in Nicotiana species. To study the effect of alkaloid composition on bacterial community composition in floral nectar, we compared the nicotine-rich wild type (WT) N. attenuata, the nicotine biosynthesis-silenced N. attenuata that was rich in anatabine and the anabasine-rich WT N. glauca plants. We found that the composition of these secondary metabolites in the floral nectar drastically affected the bacterial community richness, diversity and composition. Significant differences were found between the bacterial community compositions in the nectar of the three plants with a much greater species richness and diversity in the nectar from the transgenic plant. The highest community composition similarity index was detected between the two wild type plants. The different microbiome composition and diversity, caused by the different pyridine-type alkaloid composition, could modify the nutritional content of the nectar and consequently, may contribute to the change in the nectar consumption and visitation. These may indirectly have an effect on plant fitness.