Luckily, there a few ways that you can stave off the inevitable.

Buy Local

If you haven’t bought your pumpkins yet, make sure to buy them from somewhere local. This way you won’t have pumpkins that have been bumped and bruised by traveling around a faraway place. These shipped pumpkins won’t last as long as local ones.

Make Sure You Scoop the Inside Clean

If you’re not exactly sure where your orange gourd came from, that’s alright. There are still other things you can do to keep your pumpkin fresh. When you’re emptying the seeds and gunk from inside your pumpkin, make sure that you don’t leave anything behind. The leftover bits can cause mold, which will make your jack-o-lantern to wilt faster.

A Little Halloween Alchemy (Well, Actually, Chemistry)

After you carve your pumpkin, you should create a water and bleach solution. There should be one tablespoon of bleach per quart of water, according to USA Today. Spray the solution on the inside of your pumpkin to kill any bits of bacteria and mold that are insisting on hanging around to ruin your precious pumpkin. (If you want to put a real candle inside your jack-o-lantern, skip this next preservation step unless you want your pumpkin to go up in flames.) Rub petroleum jelly on the carved edges of your pumpkin, but we repeat, only do this if you plan on lighting your pumpkin with a pumpkin light. Lighting your pumpkin without a flame is also a great way to make it last longer. You’re essentially cooking your pumpkin and drying it out when you put a candle inside. This is fine if you only want your pumpkin to last for a few days, but if you’re planning on your jack-o-lantern to hang around until Thanksgiving, use an artificial light.

Don’t Leave Your Pumpkin Out at Night (Really!)

If you live in a place with either very hot or very cold temperatures, remember to bring your pumpkin in at night when you’ve stopped proudly displaying it for your neighbors. Extreme temperatures will cause pumpkins to rot. If it’s hot outside, fruit flies might also decide that your pumpkin is a tasty treat, so you might also want to think about putting a fruit fly trap near your pumpkin. The elements aren’t going to be kind to your pumpkin, but your pumpkin is its own worst enemy. You have to remember that your pumpkin is off the vine, which means it’s on a very slow march toward death. This will happen no matter how much petroleum jelly you put on it. In addition to the bacteria you saved your pumpkin from, it’s also in danger of drying out. That’s a fine line you have to walk. If you spritz your pumpkin every day with that bleach and water solution, you should be able to keep it around for a while. The only sure-fire way to keep your pumpkin from rotting is not to carve it at all and to just display it by your doorstep whole. You could always paint your pumpkin or put some stickers on it, but for some, that’s not the same as a good old-fashioned, glowing jack-o-lantern.