Molecularly imprinted polymers (MIPs) for caffeic acid (CA) were prepared using 4-vinylpyridine and methacrylamide (MAM) as functional monomers, divinylbenzene as a crosslinker and acetonitrile–toluene (3:1, v/v) as a porogen by precipitation polymerization. The use of MAM as the co-monomer resulted in the formation of microsphere MIPs and non-imprinted polymers (NIPs) with ca. 3- and 5-μm particle diameters, respectively. Binding experiments and Scatchard analyses revealed that the binding capacity and affinity of the MIP to CA are higher than those of the NIP. The retention and molecular-recognition properties of the prepared MIPs were evaluated using water–acetonitrile and sodium phosphate buffer–acetonitrile as mobile phases in hydrophilic interaction chromatography (HILIC) and reversed-phase chromatography, respectively. In HILIC mode, the MIP showed higher molecular-recognition ability for CA than in reversed-phase mode. In addition to shape recognition, hydrophilic interactions seem to work for the recognition of CA on the MIP in HILIC mode, while hydrogen bonding and hydrophobic interactions seem to work for the recognition of CA in reversed-phase mode. The MIP had a specific molecular-recognition ability for CA in HILIC mode, while other structurally related compounds, such as chlorogenic acid (CGA), gallic acid, protocatechuic acid and vanillic acid, could not be recognized by the MIP. Furthermore, the MIP was successfully applied for extraction of CA and CGA in the leaves of Eucommia ulmodies in HILIC mode.