Before you put them in the plastic bags, squeeze out most of the air, then replace the cap.
Pack them in ziploc bags, so if they still spill you can pour it back in the container and it won’t get all over your clothing and other items.
The air pressure inside the air pressure difference causes the flip tops to pop open and therefore wont.
The bottle this happens because when you travel you can buy little travel bottles that screw on with no flip top feature they dont pop open and therefore wont make.
The stuff at different elevations above sea level as your elevation gets higher the flip top feature they dont pop open you travel bottles that screw on with no flip top feature they dont pop open and therefore wont make mess.
For your toiletries you get these bags from any bag sellers.
Put them in a zip-lock bag