As photonic bandgap (PBG) technology matures and practical devices are realized, the effects of environmental factors, such as ambient temperature, on PBG device operation must be considered. The position of a PBG is determined by the geometry and refractive index of the constituent materials. Therefore, a thermally induced material expansion or refractive index change will alter the location of the PBG and affect the operation of PBG devices. In order to achieve faster switching times for PBG optical interconnects, enhanced sensitivity for PBG sensors, and smaller channel spacing for PBG-based wavelength division multiplexing, increasingly narrow PBG resonances are required. The drawback for the improved device operation is increased sensitivity to small changes in environmental conditions. A method to control and eliminate thermally induced drifts of silicon-based PBG structures has been developed based on a simple oxidation treatment. Oxide coverage of the silicon matrix provides a counterforce to the effect of the temperature dependent silicon refractive index. Depending on the degree of oxidation achieved, a redshift, no shift, or a blueshift of the PBG resonance results when the silicon-based PBG structure is heated. Control over the effects of thermal fluctuations has been demonstrated for two different PBG structure designs. Extensive reflectance and x-ray diffraction measurements have been performed to understand the mechanism behind this oxidation procedure as it relates to one-dimensional silicon-based PBG microcavities.