Yes, pesto does go bad. Store-bought pesto should provide a use-by or expiration date on the label. If you make homemade pesto, you can store it in an airtight container for up to one week in the refrigerator or for up to 6 months in a sealed freezer-safe container.