The zeolites ZSM-5 with different Si/Al ratios were modified with a buffer solution of HF and NH4F. This acidic treatment led to the obtaining of a material with secondary mesoporosity. The deposition of cobalt from an aqueous solution of cobalt acetate on the surface of treated samples generates the formation of different cobalt oxide species: bulk-like Co3O4 phases strongly interacting with the support, Co2+ in ion exchange positions (γ and β sites) and silicate-like phases. The mechanism of cobalt silicate phase formation is proposed here and includes a replacement of silanol groups and the bridging hydrogens by Co and the inclusion of the Co atoms in tetrahedral framework positions. The catalysts, obtained through use of the treated ZSM-5, exhibit higher activity in the reactions of propane, and n-hexane completes oxidation compared with the catalyst samples containing un-treated zeolite. Both the finer dispersion of metal oxide particles on the hierarchical sample and the presence of secondary mesoporosity improve the effectiveness of the active phase utilization via access to larger number of active sites.