All-inorganic perovskite quantum dots (QDs) have emerged as potentially promising materials for lighting and displays, but their poor thermal stability restricts their practical application. In addition, optical characteristics of the blue-emitting CsPbX3 QDs lag behind their red- and green-emitting counterparts. Herein, we addressed these two issues by doping divalent Cu2+ ions into the perovskite lattice to form CsPb1- xCu xX3 QDs. Extended X-ray absorption fine structure (EXAFS) measurements reveal that doping smaller Cu2+ guest ions induces a lattice contraction and eliminates halide vacancies, which leads to an increased lattice formation energy and improved short-range order of the doped perovskite QDs. This results in the improvement of both the thermal stability and the optical performance of CsPb1- xCu x(Br/Cl)3 QDs, which exhibit bright blue photoluminescence at 450-460 nm, with a high quantum yield of over 80%. The CsPb1- xCu xX3 QD films maintain stable luminescence performance even when annealed at temperatures of over 250 °C.