One of the primary causes for the failure of glass ionomer cement (GIC) is secondary caries. To enhance the anti-microbial performance of GIC without affecting its mechanical properties, chlorhexidine (CHX) was encapsulated in expanded-pore mesoporous silica nanoparticles (pMSN) to synthesize CHX@pMSN. CHX@pMSN was added at three mass fractions (1%, 5%, and 10% (w/w)) to GIC powder as the experimental groups. Pure GIC was set as the control group. The mechanical and anti-biofilm properties of GIC from each group were tested. The results demonstrated that CHX was successfully encapsulated on/into pMSN, and the encapsulating efficiency of CHX was 44.62% in CHX@pMSN. The anti-biofilm ability was significantly enhanced in all experimental groups (p < 0.001) compared with that in the control group. CHX was continuously released, and anti-biofilm ability was maintained up to 30 days. In addition, the mechanical properties (compressive strength, surface hardness, elastic modulus, water sorption, and solubility) of 1% (w/w) group were maintained compared with those in the control group (p > 0.05). In conclusion, adding 1% (w/w) CHX@pMSN to GIC led to conspicuous anti-biofilm ability and had no adverse effect on the mechanical properties of this restorative material. This study proposes a new strategy for preventing secondary caries by using CHX@pMSN-modified GIC.