The present disclosure relates to a method for controlling a wind turbine of the type including a rotor, a generator, a frequency converter, a control unit and means for connecting to a wind farm grid, using means for receiving a local voltage reference value (VREF) and a regulator (1) which calculates the reactive power to be generated (QT) as a function of the voltage error (ΔV), such that it can be operated over the entire voltage range. The system also includes: at least one saturator element (2, 6, 7) in which the reactive power to be generated is limited, whereby the limits (Q—MAX, Q—MIN, QC<sub2>—</sub2>MAX, QC<sub2>—</sub2>MIN, QS<sub2>—</sub2>MAX, QS<sub2>—</sub2>MIN) are calculated dynamically as a function of the voltage, this block outputting a reference reactive power of the wind turbine (Q—REF, QC<sub2>—</sub2>REF, Qs<sub2>—</sub2>REF); and an element (3) for calculating the actual limit of the active power (PMAX) as a function of the pre-limited reactive power (Q—REF, Qs<sub2>—</sub2>REF) and the apparent power available at that moment.