The aim of this work was the synthesis of a mesoporous geopolymer material based on Moroccan clay rich in kaolinite. For developing the porosity of the geopolymer material, we have followed three different ways to create mesoporosity in the studied material which are; use of Cetyl trimethylammonium bromide (CTAB) organic surfactant, hydrogen peroxide (H2O2) addition to CTAB solution during synthesis and finally no use of CTAB surfactant and H2O2 blowing agent; only optimizing the geopolymerization temperature at 70 °C as well as the formulation ratios: H2O/Na2O = 15, Si/Al = 2 and Na/Al = 1.5. Our started and prepared materials were characterized by X-ray Diffraction (XRD), Fourier Transform Infrared (FTIR), Thermal Gravimetric Analysis (TGA), nitrogen adsorption-desorption isotherm analysis (BET and BJH methods) and Scanning Electron Microscopy (SEM). The prepared materials present a very interesting specific surface area witch reached 128 m2/g and homogeneous mesoporosity equal about 0.14 cm3/g. It has been tested in the retention of methylene blue as cationic dye model. The maximum amount retained was drastically improved from 60 to 183 mg/g.