The traditional hydrothermal synthesis strategy of ZSM‐5 zeolite is energy‐consumption accompanying by pollution issues. Herein, phosphorus‐modified layered ZSM‐5 zeolites (PZ) were obtained by one‐pot synthesis under solvent‐free conditions. The synthesized samples were fully characterized by XRD, SEM, BET, NH3‐TPD and FTIR. The effect of phosphorus addition on the morphology and catalytic activity of ZSM‐5 was investigated. The results showed that phosphorus‐modified ZSM‐5 zeolites exhibited higher light olefin (ethylene and propylene) selectivity (above 50 %) and longer catalytic lifetime (33 h) in methanol to olefin (MTO) reaction when the weight hourly space velocity was 4 h−1. Phosphorus‐modified ZSM‐5 zeolite synthesized by in situ solvent‐free method, which not only reduced the discharge of sewage but also showed a simple method to realize the introduction of phosphorous species, which provided a new idea for phosphorus modification of ZSM‐5 zeolite.