When kept in an airtight container or jar with a tight-fitting lid, pesto will last for around 2 weeks in the fridge.