Electrochromic smart windows have attracted more attention from researchers due to their potential applications for energy conservation in buildings. As the most key component, the electrochromic layer is still limited by the complexity of the preparation process and poor performance, such as lower stability, slow response time, and low coloration efficiency. In this study, as a simple and expedient method, electrodeposition is successfully used to prepare amorphous WO3 films doped with P. By optimizing the amount of P in the PW-2 film, a large optical modulation of 80.8% at 550 nm is achieved, and the P-doped amorphous WO3 film also shows a fast response time, a high CE, and good cycling stability. The mechanism of the P-doped amorphous WO3 films to improve the electrochromic properties is as follows. Firstly, by appropriate phosphorus doping, the stress of the film is released, and the binding force is improved. Secondly, the films possess proper cracks, which accelerate the diffusion of ions. Thirdly, the films make the nanoparticles more uniform, and provide more active sites. Furthermore, the electrochromic smart windows based on the P-doped amorphous WO3 film display a large temperature difference of 11 °C, which indicates good solar thermal regulation ability, and promises practical applications for building energy conservation.