Ionic liquid of [BMIM][BF4] based sol–gel modified electrode ([BMIM][BF4]/Gel/Au electrode) was prepared by immobilization of [BMIM][BF4] into silica sol–gel matrix on the surface of Au electrode via a simple sol–gel method. Taking advantage of ion exchange reaction between [BMIM][BF4] and K3Fe(CN)6, Fe ( CN ) 6 3 - was entrapped into the sol–gel matrix when [BMIM][BF4]/Gel/Au electrode was immersed in K3Fe(CN)6 solution. Following by continuously scans, the cyclic voltammograms of the resulting [BMIM]3Fe(CN)6/Gel/Au electrode in K3Fe(CN)6 solution behaved “PB (Prussian Blue)-growing pattern”. FTIR, elemental analysis and UV–Vis absorbance spectra results manifested the formation of PB in the sol–gel matrix. Furthermore, the formation mechanism, kinetics and stability of the PB/Gel/Au electrode formed by this method were discussed.