Using heterogeneous basic catalysts has a great importance in chemical reactions because of their advantages (such as easy separation and thermal stability at harsh conditions) over homogeneous catalysts. In this study, magnetic mesoporous silica nanoparticles (mSiO2) containing graphitic carbon nitride layers (mSiO2/g‐C3N4(x)) were fabricated through a facile process (x signifies the amount of melamine applied during synthesis). Graphitic carbon nitride layers were decorated on mSiO2 by calcination of immobilized melamine (as graphitic carbon nitride precursor) on mSiO2 in the last step of catalyst synthesis. The structure of the prepared catalysts was confirmed using XRD, BET, FESEM, EDX, elemental mapping and TEM methods. The catalytic efficiency of the so‐obtained solid base composite was investigated for the synthesis of some dihydropyranochromenes and spiro‐dihydropyranochromenes under thermal and microwave conditions. Using mSiO2/g‐C3N4(x) led to high yields under green conditions and in short reaction times and without a decrease in catalytic activity after four consecutive cycles.