With baking season around the corner, it’s time to (finally!) get a handle on how to properly store baked goods. With the right moves, you can bake your treats ahead of time and still serve up fresh pies, melt-in-your-mouth cookies, and moist cakes a little later.  Because what good is spending all that time preparing something delicious that falls flat at serving time?

Here’s a quick guide on how to store our favorite baked goods from iced cupcakes to brownies to pies of all kinds. Yay for planning ahead!

Or at least for being well armed to plan ahead, you know, if you can swing it.

The best way to store every kind of baked goods to keep them fresh: Storing pies, cakes, cookies, brownies, donuts and more | coolmomeats.com

The best way to store unfrosted cake, cupcakes, muffins, sweet breads

How to store unfrosted cakes, cookies and breads you've made ahead of time to keep them freshest | Cool Mom Eats

The most important tip for successfully storing all baked goods is to let them cool completely

Wrapping warm cakes, cupcakes, sweet breads, and baked donuts will capture steam, which is the enemy of fresh food storage.

So be sure to let your cake cool to room temperature, then to preserve it, wrap it tightly all around in plastic wrap. Do not keep it on a platter or plate and wrap that — you want the whole baked item to be as tightly sealed as possible.

Alternatively, you can place donuts and cupcakes (both of which are a pain to wrap individually) in a plastic storage bag. It’s not quite as reliable a method, but should do the job well if you make sure to press out all the air before sealing the bag shut.

As long as your kitchen is fairly cool and dry, you can store plastic wrapped cakes on the counter for 3-5 days. If it’s hot or humid, store them in the refrigerator instead; just make sure to return them to room temperature for serving.

You can also store cakes and similar baked goods without icing in the freezer for up to 3 months. Thaw completely before icing and serving; do this by placing the cake in the refrigerator 24 hours before you plan to frost it.

Note that allowing a frozen cake to thaw at room temperature can cause moisture to collect under the plastic wrap, which will make your cake mushy. So don’t do that.

The best way to store whole, uneaten cakes, cupcakes, sweet breads

How to store a whole frosted cake to keep it fresh | Cool Mom Eats

Well, this is easy! It turns out that frosting acts as a seal and eliminates the need to wrap cakes in plastic (which would just smoosh your awesome frosting job anyway).

Instead, find a way to cover your cake without touching it to protect it from dirt and dust. Thus, why you see toothpicks in cakes a lot.

If you’re big on making cakes, you might want to invest in a decent cake keeper (this one under $20 from our affiliate Amazon), which is perfect for the job. Otherwise, try Macgyvering your own cake keeper using a big upside down mixing bowl.

You can store a frosted cake like this one at room temperature for 3-5 days but, again, if it’s hot and humid, stick it in the refrigerator instead. You’ll also want to keep it in the refrigerator the whole time if your frosting is made with cream cheese; never let cream cheese or whipped cream icings sit at room temperature.

If you don’t have a cake keeper and kitchen hacks aren’t your thing, a great trick is to place your frosted cake in the refrigerator for at least 30 minutes, allowing the icing to harden. Then carefully cover with plastic wrap and return it to the refrigerator. Just know that you’ll need to leave time to return the cake and icing to room temperature and retouch the icing before serving. You may even want to keep a little extra icing on the side to help.

You can also freeze an uncut cake that has been frosted, but the defrost process is well, a bit of a process. Making sure that condensation keeps from forming on the icing is tricky so, unless you’re a hardcore baker, I’d avoid this technique.

The best way to store cake, cupcakes, or sweet breads: Cut, with or without frosting

How to store leftover cake, with or without frosting, after it's been cut | Funfetti Birthday Cake from My Name is Yeh

Funfetti Birthday Cake recipe | My Name is Yeh

If plastic wrap or icing seal a cake’s moisture in, a cut (even just one!) lets moisture out. The best way to keep moisture from escaping cake that’s already been sliced—oh, say, leftover Funfetti Birthday Cake like this one that we found at My Name is Yeh—is to seal the cut sides back up.

You can do this with (you guessed it) plastic wrap or icing.

Just press the wrap up against the cut sides, making sure that you seal them tightly against any exposed cake, or frost the cut sides so that the cake is fully iced again.

A cake “re-sealed” like this can keep on the counter or in the refrigerator just like an uncut cake, but will last only 2-4 more days. Again—this is important—if the cake is iced with cream cheese or whipped cream frosting, skip the counter and go straight to the fridge for the entire storage time.

Related: 7 must-try sheet cake recipes that make every celebration better

The best way to store cookies

How to store homemade cookies to keep them fresh | Linzer Cookies recipe via Fox in the Kitchen

Linzer holiday cookies recipe | Fox in the Kitchen

Just as with cakes, your cookies need to cool completely before you store them. Ideally, you want to store cookies only with other like cookies. If you can’t do this—for example, if you’re trying to save varying types of holiday cookies like these gorgeous Linzer Cookies we found at Fox in the Kitchen and Santa’s favorite chewy chocolate chips cookies—at least try to separate soft cookies from crispy ones.

Soft cookies can be kept in an airtight container or freezer storage bag, while crispy cookies should be stored in a loosely covered container (unless it’s really humid where you live, in which case put crispy cookies in an airtight container, too). You can keep the containers on the counter or, if it’s hot and humid, in the refrigerator. Both types of cookies will keep like this for 3-5 days.

Related: The secret ingredient that will make you even more obsessed with chocolate chip cookies.

Pro tip: When storing soft cookies, add a slice of bread to the container or bag to help keep them moist. Discard the bread before enjoying the cookies or, if it goes stale, replace it until the cookies are all gone.

You can also store cookies in the freezer for up to 3 months. Freeze unfrosted cookies by wrapping individual cookies in freezer wrap or, as a second choice, placing them all together in a freezer bag. To freeze iced cookies, place them in a single layer on a baking sheet in the freezer. Once frozen solid, layer them in a freezer bag with wax paper placed between each layer.

The best way to store a pan of uncut brownies

How to store brownies made ahead of time: Great tips | Bourbon Caramel Topped Bacon Brownies | KitchenAid blog

Bourbon Caramel Topped Bacon Brownies | The KitchenAid blog

Brownies are easy peasy if they aren’t frosted. If they are, see notes on storing frosted cake above or, like in the case of these Bourbon Caramel Topped Bacon Brownies (whoa!) or the Peanut Butter Brownie recipe we love from the I Heart Naptime Cookbook,  save the topping for right before serving and store unfrosted brownies by covering the pan with plastic wrap, making sure to get a really good seal.

Or, if you want to be extra sure to keep them in tip-top shape, carefully remove the brownies from the pan and wrap the whole square very tightly all around, the same way you would an unfrosted cake. You can leave wrapped brownies on the counter for up to 3 days. If it’s hot and humid where you live, you know the deal by now: store them in the fridge instead.

Of course, there’s also the freezer: Just like with an unfrosted cake, remove uncut brownies from the pan and wrap the whole square very tightly in plastic wrap. Place them in the freezer for up to 3 months.

Related 8 of the very best brownie recipes for every taste

The best way to store cut brownies

How to store leftover brownies to keep them fresh | Extra Nutty Dark Chocolate Brownies at Joy the Baker

Extra Nutty Dark Chocolate Brownies recipe | Joy the Baker

When you bake a batch of brownies as delicious looking as these Extra Nutty Dark Chocolate Brownies that we found at Joy the Baker and included in our roundup of 8 of the very best brownie recipes from top food bloggers, you just may have to take a bite before saving the rest for later.

To store cut brownies for a few days, layer them in an airtight container or in a sealed freezer bag with wax paper placed between the layers. Just like with cookies, you can also add a piece of bread to help the brownies retain their moisture.

To freeze, wrap individual brownies tightly in plastic wrap and keep for up to 3 months.

The best way to store pies of all kinds

How to store every kind of pie so they're delicious days later | CoolMomEats.com

Hearty though many may seem, pie is the most delicate of all baked goods since the crust can easily go soggy. There are also so many types! Here’s a quick run down, remembering that the first step is always to let your pie cool completely before doing anything else.

Fruit pies can be made up to 3 days ahead of time. Cover with plastic wrap and leave at room temperature for 1-2 days. If storing for longer, place in the refrigerator. You can also freeze uncut, fully baked fruit pies by freezing them solid before wrapping them tightly with plastic wrap and placing in a large, heavy duty freezer bag. Keep frozen pies for up to 3 months; defrost in the refrigerator and reheat in a 350 degree oven for 20-30 minutes, until just warmed through.

Pies that have egg in their filling, like pumpkin, can be covered with plastic wrap and must be stored in the refrigerator for up to 4 days.

Traditional custard and cream pies are truly best served the day of, but if you want to make one ahead, try to do it the day before. Then, cover loosely with plastic wrap and refrigerate. In a pinch, you can do this up to 2 days ahead.

Lastly, you can prep pies and freeze them before baking. This works best with fruit pies: Assemble them (do not cut slits in the top if you’re making a double crust pie) and place in freezer until frozen solid. Then wrap in plastic wrap and place in a heavy duty storage bag for up to three months. When ready to serve, transfer the pie straight from the freezer to a preheated oven—do not thaw first!

Related: 6 creative pie crust alternative, because life’s too short for rolling dough

Custard and other pies with eggs in their filling are trickier when it comes to storing them well. Freeze the filling and unbaked crust separately. Then, thaw the filling in the refrigerator 24-48 hours before baking and either partially bake the crust before putting the two together or thaw the crust, fill and bake.