Hi! I recently bought some bagged potting soil and left it on the porch without thinking, and realized there is a big hole. I am going to bring it inside to store, but was wondering if there is something safe to treat it with to prevent/get rid of any bugs, but that won't harm my plants?
If it is dry then seal it inside a plastic storage bin.
If you can bake it, that will kill most organisms, but stick up the house. (Do you have a bar-b-que you could use?) Soak the soil well with water, then bake it dry. The steam generated in baking kills things.
Most things that kill bugs could be watered into the soil, but with varying effectiveness, and varying amounts lingering to affect the future use of the material.
The soil could be solarized. Moisten it, seal it in a clear plastic bag, as sturdy plastic as you can get, and large, so the soil is not very deep, and place it in the sun for a few days. Then turn it over, stir the soil and lay it in the sun again. The maximum heat is generated when the sun passes through clear materials like glass or plastic and this will kill a lot of things. If you have a box with a glass lid (Like an old style cold frame) that could work too. I made such a box, about 3' x 3' x 1' out of wood with some insulation, a thick bottom (insulated) and a glass lid (old window). That worked really well for what I was doing. Got really hot in there.
I often have the same problem as you have had re potting compost, to be absolutely fair, I have never done anything to the compost other than use it in the normal way, as for bugs, I would have found them while working with the compost, as for animals, like small rodents, I would have found them or traces off such like dropping ect.
I guess it all depends on what you want to use the potting soil for, bulbs, tubers, Rhizomes and the like would be fine as IF there was anything in the soil, over winter you would be checking on them anyway and you would notice problems IF any.
IF your growing seeds or something needing a sterile type of soil them by all means try to sterilise the soil yourself but it's a lot of trouble to go to for a bag of potting soil that costs a few dollars, I would buy another bag of the same and use the open bag perhaps in the garden or re-potting more robust plants like small shrubs or the like as they are a bit tougher should the chance in a million come your way and something has got into the potting mix.