Track irregularities, caused by reasons such as track deformation and installation error, are common in real maglev line. These disturbances brought by tracks exert an adverse influence on the performance of a maglev train levitation system. It takes a lot of maintenance costs and time to keep the tracks in a good condition. In another way, a disturbance rejection through a controller optimization method is proposed in this paper. First, the influences of the track irregularity disturbances on levitation performance are illustrated in detail. Then, an online optimization of the PnP control architecture method is adopted to reject the disturbances caused by track irregularities. The effectiveness of this method is verified through the MATLAB simulation. This method makes the levitation system adaptive to known and unknown time-varying track irregularities, saving time, and human resources. INDEX TERMS Maglev train, online optimization, PnP control architecture, track irregularity.