In this study, we report the application of synchrotron radiation nanoprobe techniques to the structural analysis of pyramidal defects in Mg doped GaN. A combination of fluorescence mapping with spectroscopic techniques enabled us to examine not only the elemental nature but also their crystallographic orientation on the submicron scale. Our observations provide strong evidence for the diffusion and subsequent segregation of background impurities of Fe and Cr on the sample surface, with the absence of pronounced sequential stacking compared with Ga atoms. The strong polarization-dependent x-ray absorption near-edge structure features showed the preservation of the hexagonal crystalline structure in both defect-free and hexagonal pyramids. From the spatially resolved x-ray linear dichroism, no preferential disorder was observed in the direction parallel or perpendicular to the crystal growth.