A novel strategy of approximate ligand substitution was proposed to introduce ionic liquids (ILs) into the porous framework of metal−organic frameworks (MOFs). With this approach, an efficient Brønsted−Lewis acidic catalyst [(CH 2 COOH) 2 IM]HSO 4 @H-UiO-66 was successfully constructed via bidentate coordination between one −COO − group of [(CH 2 COOH) 2 IM]HSO 4 and two portions of unsaturated Zr ion defects of the hierarchically porous Zr metal−organic framework (H-UiO-66). The catalyst was systematically characterized by Fourier transform infrared spectroscopy, X-ray diffraction, nitrogen adsorption− desorption, scanning electron microscopy, and thermal gravimetric analysis, proving the feasibility of this encapsulation mode. The fabricated [(CH 2 COOH) 2 IM]@H-UiO-66 catalyst was applied for synthesis of biodiesel, and the reaction conditions were optimized by response surface methodology. The resulting Brønsted−Lewis acidic [(CH 2 COOH) 2 IM]HSO 4 @ H-UiO-66 catalyst exhibited excellent catalytic performance for the esterification of oleic acid with methanol. Under the optimum condition, the predicted yield of biodiesel reached 93.71% and the experimental value was 93.82%, which indicated the synthesized catalyst has high catalytic activity. Moreover, the catalyst could be easily recovered and reused, and the yield of biodiesel decreased from 93.82 to 90.95% after five runs, indicating good reusability. Besides, based on the synergistic effect of Brønsted acidic and Lewis acidic parts, the catalytic mechanism of [(CH 2 COOH) 2 IM]@H-UiO-66 was also discussed.