PurposeThe purpose of this paper is to optimize the maintenance strategies for wind turbine (WT) gearboxes to minimize costs associated with PM actions, cooling, production loss and gearbox replacement. Two approaches, periodic imperfect maintenance and a novel design incorporating alternating gearboxes are compared to identify the most cost-effective solution.Design/methodology/approachThis study employs mathematical modeling to analyze the design, operation and maintenance of WT gearboxes. Two maintenance strategies are investigated, involving periodic imperfect maintenance actions and the incorporation of two similar gearboxes operating alternately. The models determine optimal preventive maintenance (PM) and switching periods to minimize total expected costs over the operating time span.FindingsThe research findings reveal, for the considered case of a moroccan wind farm, that the use of two similar gearboxes operating alternately is more cost-effective than relying on a single gearbox. The mathematical models developed enable the determination and comparison of optimal strategies for various WT gearbox scenarios and associated maintenance costs.Research limitations/implicationsLimitations may arise from simplifications in the mathematical models and assumptions about degradation, temperature monitoring and maintenance effectiveness. Future research could refine the models and incorporate additional factors for a more comprehensive analysis.Practical implicationsPractically, the study provides insights into optimizing WT gearbox maintenance strategies, considering the trade-offs between PM actions, cooling, production loss and gearbox replacement costs. The findings can inform decisions on maintenance planning and design modifications to enhance cost efficiency.Social implicationsWhile the primary focus is on cost optimization, the study indirectly contributes to the broader societal goal of sustainable energy production. Efficient maintenance strategies for WTs help ensure reliable and cost-effective renewable energy, potentially benefiting communities relying on wind power.Originality/valueThis paper introduces two distinct strategies for WT gearbox maintenance, extending beyond traditional periodic maintenance. The incorporation of alternating gearboxes presents a novel design approach. The developed mathematical models offer a valuable tool for determining and comparing optimal strategies tailored to specific WT scenarios and associated maintenance costs.