Postweld plastic deformation was reported to be able to largely enhance the mechanical properties of friction stir‐welded (FSW) Mg alloys by changing microstructures in the regions with a soft‐oriented texture. However, few studies have concentrated on the effects of postweld plastic deformations on the corrosion behavior of FSW Mg alloys, which has an impact on their application. In the present study, electrochemical measurements, hydrogen evolution, and mass loss tests were used to study the influences of postweld compression along the transverse direction and subsequent annealing on the corrosion rate of FSW AZ31 Mg alloys. It was found that owing to the grain refinement in the weld zones, an improvement in the corrosion resistance and hardness was observed in the FSW AZ31 sample compared to the base metal (BM) sample. Postweld compression was very harmful to the corrosion resistance of the FSW AZ31 alloys. On the basis of the mass loss results, the corrosion rate of the compressed FSW sample was ~17.62 mm/year, which was ~8.99 times that of the FSW sample (~1.96 mm/year). Subsequent annealing could slightly reduce the corrosion rate of the compressed FSW AZ31 plates, whereas the corrosion rate of the FSW‐C‐T sample (~13.63 mm/year) was much worse than that of the BM sample (~4.73 mm/year).