Developing a packaging material with integrated cushioning, intelligent and active functions is highly desired but remains challenging in the food industry. Here we show that a sponge-like porous hydrogel with pH-indicating and antibacterial additives can meet this requirement. We use polyvinyl alcohol and chitosan as the primary polymers to construct a hydrogel with hierarchical structures through a freeze-casting method in combination with salting-out treatment. The synergy of aggregated polymer chains and the sponge-like porous structure makes the hydrogel resilient and efficient in energy absorption. It also enables rapid movement of molecules/particles and fast reaction due to the large specific surface area of the pore structures and the large amount of free water in it, leading to a sensitive pH-indicating function. The hydrogel shows an obvious color variation within a wide pH range in 3 min. The silver nanoparticles are fixed in the dense polymer networks, enabling a lasting release of silver ions. The porous structure makes the silver ion reach the protected item in a short time, achieving an antibacterial effect against S. aureus and E. coli with little cytotoxicity. This work paves the way for fabricating multifunctional hydrogels for diverse advanced packaging systems.