In the present study, aluminum pillared montmorillonite clay was modified with cationic corrosion inhibitors Ce3+/Zr4+. The modification of the montmorillonite clay was carried out by two methods; (a) by simple mixing of inhibitor solutions along with clay by stirring for 30 min and (b) by homogenization of inhibitor solutions and clay for a very short time of 15 min followed by evacuation. The modified and as-received clays were dispersed in hybrid organic-inorganic sol-gel matrix silica sol, which were coated on magnesium alloy AZ91D and cured in air at 130 °C for 1 h. Corrosion protection ability of coatings was evaluated by electrochemical impedance spectroscopy, potentiodynamic polarization and weight loss measurements after exposure to 3.5 wt% NaCl solution for different exposure durations between 24 h to 120 h. Coatings were evaluated for their self-healing ability using scanning vibrating electrode technique for varying time duration from 1 h to 24 h. Coatings generated with the sol using the pillared montmorillonite clay after modification as described in (b) were found to exhibit better anticorrosive properties even after prolonged exposure to the corrosive medium.