With the rapid increase of wind power penetration, the frequency indicators of power system, encompassing frequency deviation and rate of change of frequency (RoCoF), are prone to exceed the pertinent relay thresholds, thus leading to serious power outages. Wind farms can participate in primary frequency regulation (PFR) to alleviate the above problem. However, wind farms reserve capacity (WFRC) presented by overspeed control and pitch angle control is the important factor for frequency safety especially when large disturbance occurs, and it varies obviously in different conditions. Thus, WFRC should be utilized optimally to avoid insufficient or excessive response of wind farms in PFR. To overcome the challenge, this paper proposes frequency‐trajectory‐oriented control (FTOC) for wind farms based on a two‐fold optimization framework, seeking to obtain the best frequency control performances in PFR through realizing the optimal compromise between frequency results and the consumption of WFRC. First, when the frequency indicators deviate significantly from the normal values, the optimal frequency trajectory is planned periodically according to the local standards and operation conditions, thereby minimizing the total consumption of WFRC on the premise of frequency safety. Second, based on model predictive control and a real‐time power system parameters estimator, the total reference power of wind farms, which helps the frequency track the latest planned trajectory, is optimally distributed among wind generators according to their reserve capacity. In this case, through the optimal frequency trajectory planning and tracking, the new method in this paper not only effectively prevents the frequency results from exceeding the local standards under diverse conditions, but also finds the optimal balance among frequency indicators safety, frequency trajectory smoothness, and the reserve capacity consumption of wind power generators. Finally, the simulation results prove the effectiveness and advancement of FTOC.