Pesto can become bitter if the basil has flowered or gone to seed. In this case, add a splash of white balsamic vinegar or honey to balance the bitterness. If pesto is bitter because the olive oil has gone rancid, it is best to throw it out. Always taste your ingredients before using.