In this study, a UV-filter encapsulated in a mesoporous silica, MCX-MS, was prepared by the in-situ sol–gel polymerization of tetraethyl orthosilicate (TEOS) with an ionic liquid (IL) as solvent and pore-forming agent and octal methoxycinnamate (MCX) as an additive. MCX-MS was characterized by Fourier transformation infrared (FT-IR) spectroscopy and transmission electron microscopy (TEM). The result of the thermogravimetric analysis (TGA) showed that the amount of MCX encapsulated in MS was about 65 wt.% of MCX-MS. Comparing with that of the free MCX, the SPF value of the MCX-MS-containing sunscreen cream increased by about 57%, indicating significant enhancement of the UV protection ability of MCX by encapsulation in the mesoporous silica matrix. Furthermore, because the average particle size of MCX-MS emulsion droplets was big enough, damage by penetration through the skin is expected to be prevented.