Hydrogels are incorporated into microfluidic devices to provide enhanced functionality by enabling processes such as enzyme immobilization, sample enrichment, and ionic current rectification. However, in the microfluidic devices with the commonly used material poly(dimethylsiloxane) (PDMS), hydrogels are very difficult to polymerize in situ in an ambient atmosphere because of the high oxygen concentration in PDMS. Even with very high (1.8%) photoinitiator concentrations, the polymerized hydrogel does not completely fill the microchannel. Here, we report a facile and broadly applicable protocol that utilizes microchannel pretreatment with 20% benzophenone in acetone to provide a hydrogel plug that completely fills the microchannel cross section by consuming the oxygen in the PDMS substrate near the microchannel wall. Both negatively charged and neutral hydrogels are polymerized from monomer solutions that utilize the photoinitiator/solvent combinations of VA-086 in water and benzophenone or IRG in DMSO. The photoinitiators were tested at different concentrations and in devices with different levels of oxidation. The hydrogel morphology is characterized using phase contrast microscopy and is related to the hydrogel's performance for concentration enrichment and ionic current rectification. A novel method is employed to confine the precursor solution in desired locations so that a photomask is not required for the spatial control of the plug location. Among six hydrogel formulations, at 100 V, the best current rectification factor obtained is ∼600 and the best analyte enrichment achieved is ∼120-fold in 5 min. This method provides a rapid and simple approach to increase the capabilities of PDMS microfluidic devices through improved polymerization of nanoporous hydrogels.