The effect of thermal annealing on the luminescence of wurtzite ZnMgO alloys in the films and ceramics produced by solid state reaction route is investigated. Formation of hexagonal ZnMgO phase is proved by X‐ray diffraction, micro‐Raman, photoluminescence (PL), and PL excitation methods. Mg starts incorporating into ZnO lattice at 700 °C, and its content increases with the increase of the annealing temperature up to 1000 °C. Nevertheless, in the PL spectra of the films annealed in air at 1000 °C, excitonic and defect‐related emissions from residual ZnO phase dominate, while those from the ZnMgO alloy are weak. The annealing in Zn vapor results in even weaker ZnMgO PL. In ceramics sintered in the air at 1000 °C, the PL from wurtzite ZnMgO phase is found to be strongly supressed on the surface and bright in the depth of a pellet. The gettering of Na, K, and Ca residual impurities at the surface of the samples under annealing is proved by Secondary ion mass spectrometry. It is proposed that degradation of ZnMgO PL in the near surface region is caused mainly by intense thermal decomposition of wurtzite ZnMgO phase accompanied by generation of non‐radiative defects.