To extend the shelf life of pesto, you can also freeze it for up to three months. I like to freeze it into individual portions using a silicone ice cube mold. Then I package the cubes into a large ziploc bag. Thaw overnight in the refrigerator or at room temperature for about 1 hour.