In my last garden, I found that my basil grew fairly quickly, flowered and then became quite bitter. The plants generally still grew and stayed healthy, but obviously the point of having a basil plant is to use in your kitchen and meals and not just take up room in your garden....well that's my reason for having it.
At our new place I have planted about five basil plants thinking this would give me enough leaves across the five little plants to make pesto and then as they grow up and become bitter I won't mind because I would have had enough leaves over all of these plants to make several batches of pesto. And then I would just replace them over time with new plants.
But I have found a sneaky trick that seems to have elongated my crop! The trick you ask... Well, it is really quite simple! All I do is remove the flower heads every time I notice these on the plants. I just pick these flower heads off and amazingly this seems to have allowed my basil plants to continue to grow, without turning really bitter and allowing them to continue to look amazing.
Wow, so simple and now I have much more basil than I ever need in the kitchen. I can also let some of them go to flower and seed, which allows new crops for another year and brings in pollinating insects that are needed more broadly in the garden.
See if this works just as well for you.