Yes, you can freeze leftover pesto to extend its shelf life. Freezing pesto is a great way to preserve it for future use and it will last for months this way. When ready to use, thaw in the refrigerator for a few hours.