Transition metal oxides (TMOs) are commonly used in a wide spectrum of device applications, thanks to their interesting electronic, photochromic, and electrochromic properties. Their environmental sensitivity, exploited for gas and chemical sensors, is however undesirable for application in optoelectronic devices, where TMOs are used as charge injection or extraction layers. In this work, we first study the coloration of molybdenum and tungsten oxide layers, induced by thermal annealing, Ar plasma exposure, or transparent conducting oxide overlayer deposition, typically used in solar cell fabrication. We then propose a discoloration method based on an oxidizing CO2 plasma treatment, which allows for a complete bleaching of colored TMO films and prevents any subsequent recoloration during following cell processing steps. Then, we show that tungsten oxide is intrinsically more resilient to damage induced by Ar plasma exposure as compared to the commonly used molybdenum oxide. Finally, we show that parasitic absorption in TMO-based transparent electrodes, as used for semitransparent perovskite solar cells, silicon heterojunction solar cells, or perovskite/silicon tandem solar cells, can be drastically reduced by replacing molybdenum oxide with tungsten oxide and by applying a CO2 plasma pretreatment prior to the transparent conductive oxide overlayer deposition.