Path planning, which is needed to obtain collision-free optimal paths in complex environments, is one key step within unmanned aerial vehicle (UAV) systems with various applications, such as agricultural production, target tracking, and environmental monitoring. A new hybrid gray wolf optimization algorithm—SSGWO—is proposed to plan paths for UAVs under three-dimensional agricultural environments in this paper. A nonlinear convergence factor based on trigonometric functions is used to balance local search and global search. A new relative-distance fitness adaptation strategy is created to increase the convergence speed of the SSGWO. Integrating the simulated annealing (SA) algorithm, an alternative position update strategy based on SA is proposed to improve the search process with diverse capabilities. Finally, a B-spline curve is introduced into a smooth path to ensure the path’s feasibility. The simulation results show that the SSGWO algorithm has better convergence accuracy and stability, and can obtain higher-quality paths in a three-dimensional environment, compared with GWO, MGWO, IGWO, and SOGWO.