Gallic acid is widely used in the field of food and medicine due to its diversified bioactivities. The extraction method with higher specificity and efficiency is the key to separate and purify gallic acid from complex biological matrix. Herein, using self-made core-shell magnetic molecularly imprinted polymers (MMIP) with gallic acid as template, a hollow magnetic molecularly imprinted polymer (HMMIP) with double imprinting/adsorption surfaces was prepared by etching the mesoporous silica intermediate layer of MMIP. The characterization and adsorption research showed that the HMMIP had larger specific surface area, higher magnetic response strength and a more stable structure, and the selectivity and saturated adsorption capacity (2.815 mmol/g at 318 K) of gallic acid on HMMIP were better than those of MMIP. Thus, in addition to MMIP, the improved HMMIP had excellent separation and purification ability to selectively extract gallic acid from complex matrix with higher specificity and efficiency.