Addressing the problem of pathogenic bacteria in human health remains a great challenge. We have prepared MgO, replicated from the leaf template, for efficient bacterial removal. The synthesis method perfectly inherits the advantage of the hierarchical three-level micro-meso-macroporous structure from the leaf template. The final product has the integrated advantages of a positively charged property, hierarchical three-level micro-meso-macroporous microstructure and sterilization property so that it could be named “the positively charged leaf”. The positively charged leaf with the microstructure, which is bestowed by Nature, could be utilized in water purification for dye removal and could be extended to pollutant removal, especially of harmful bacteria. The positively charged leaf, as the leaf shield, could be useful in protecting human health. The concept of this work could be applied to the synthesis of different functional metal oxides with hierarchical porous structures, and the products could be utilized in efficient bacterial removal.