About 70% of eyedrops contain benzalkonium chloride (BAK) as a preservative to prevent the growth of microorganisms. While preservatives are mandated to maintain sterility, many patients exhibit irritation and toxicity to such compounds. We propose to mitigate the ocular toxicity in the ocular formulations without compromising sterility by designing a device that can be incorporated into an eyedrops bottle to selectively remove the preservatives during the process of drop instillation. Here, we specifically focus on macroporous poly(2-hydroxyethyl methacrylate) (pHEMA) gel due to its excellent biocompatibility and high partition coefficient for BAK. In addition to specific selectivity for BAK, the device also requires high hydraulic permeability to allow drop dispensing without excessive pressure drop. The pHEMA monolith can remove nearly 100% of contained BAK from a 25ml, 0.012% BAK solution with negligible uptake of the hydrophilic drugs such as timolol and dorzolamide. The filter, however, had to be pre-equilibrated with hydrophobic drugs to reach a high separation of BAK without reducing the concentration of the active drug. The average hydraulic permeability of the filter was 0.025 Darcy, which is about 5-fold lower than the ideal value. Incorporation of a pHEMA macroporous gel into an eyedrops bottle can virtually eliminate the exposure of the eyes to the preservatives without compromising the sterility. Our novel design can eliminate the preservative induced toxicity from eyedrops thereby impacting hundreds of millions of patients with chronic ophthalmic diseases such as glaucoma and dry eyes.