Polar and hydrophilic properties of hydroxybenzoic acids usually made them coelute with interferences in high performance liquid chromatography (HPLC) analysis. Then selective analysis of them was necessary. Herein, hollow porous ionic liquids composite polymers (PILs) based solid phase extraction (SPE) was firstly fabricated and coupled online with HPLC for selective analysis of hydroxybenzoic acids from complex matrices. Hollow porous PILs were firstly synthesized using Mobil Composition of Matter No. 48 (MCM-48) spheres as sacrificial support, 1-vinyl-3-methylimidazolium chloride (VMIM+Cl−) as monomer, and ethylene glycol dimethacrylate (EGDMA) as cross-linker. Various parameters affecting synthesis, adsorption and desorption behaviors were investigated and optimized. Steady-state adsorption studies showed the resulting hollow porous PILs exhibited high adsorption capacity, fast adsorption kinetics, and excellent specific adsorption. Subsequently, the application of online SPE system was studied by selective analysis of protocatechuic acid (PCA), 4-hydroxybenzoic acid (4-HBA), and vanillic acid (VA) from Pollen Typha angustifolia. The obtained limit of detection (LOD) varied from 0.002 to 0.01μg/mL, the linear range (0.05–5.0μg/mL) was wide with correlation coefficient (R) from 0.9982 to 0.9994, and the average recoveries at three spiking levels ranged from 82.7 to 102.4%, with column-to-column relative standard deviation (RSD) below 8.1%. The proposed online method showed good accuracy, precision, specificity and convenience, which opened up a universal and efficient route for selective analysis of hydroxybenzoic acids from complex samples.