Using the modified Landau-Ginzburg-Devonshire thermodynamic theory, it is found that the coupling between stress gradient and polarization, or flexoelectricity, has a significant effect on ferroelectric properties of epitaxial thin films, such as polarization, free-energy profile and hysteresis loop. However, this effect can be completely eliminated by applying an optimized external, uniform electric field. The role of such uniform electric field is shown to be the same as that of an ideal gradient electric field which can suppress the flexoelectricty effect completely based on the present theory. Since the uniform electric field is more convenient to apply and control than the gradient electric field, it can be potentially used to remove the flexoelectric effect induced by the stress gradient in epitaxial thin films and to enhance the ferroelectric properties.