Undesirable side reactions often occur during the catalytic pyrolysis of olefins in FCC gasoline to produce light olefins. We proposed a method to maximize light olefin selectivity by suppressing these side reactions. In this study, P-ZSM-5 and Ce–P-ZSM-5 were prepared by the pore volume impregnation method to investigate the regulatory relationship between their acidity/alkalinity and catalytic pyrolysis. The study found that acid sites could promote the olefin conversion and adjust the cracking pathway. Furthermore, the densities of strong B acid sites and base sites could regulate olefin adsorption, affecting hydrogen transfer activity. Acid strength was crucial in controlling the aromatization reaction. It showed that thermal cracking played a minor role in catalytic pyrolysis, with methane generation mainly resulting from acid sites promoting the cracking of terminal C–C bonds. Loading phosphorus strengthens the acidity of ZSM-5, while loading cerium weakens its acidity and enhances its alkalinity. By optimizing the acidity and alkalinity of ZSM-5, side reactions were suppressed, maximizing the selectivity of light olefins. The results showed that the light olefin selectivity of Ce–P-ZSM-5 increased from 33.2% to over 80%, while the side reaction selectivity decreased from over 60% to below 10%. This work will lay a good foundation for developing catalysts for catalytic pyrolysis of olefins to produce light olefins.