The migration behavior of the population plays a significant role in the evolution of cooperation in spatial games. During the migration process, individuals may be affected by uncertain and irrational factors, and these will affect their direction of migration. In previous studies, the migration direction has been determined either entirely randomly or using entirely deterministic factors, referred to as random and directional migration, respectively. However, in real-world situations, a mixture of both random and deterministic factors will be included in individuals’ migration decisions. In this work, we examined the effects of a mixture of directional and random migration on cooperation. In our model, for the directional migration, the average migration direction of an individual’s neighbors is used. We then introduce the parameter α to adjust the proportion of directional and random migration. The results show that a small value of α and a lower speed are beneficial to cooperation. Furthermore, we find that there is always an optimal range of α that will best promote the evolution of cooperation. We explain these phenomena based on time series of the cooperation level and the order parameter, and spatial population snapshots. We also investigate the effects of the interaction radius between individuals and population density on the evolution of cooperation. The robustness of this migration mode is further verified with respect to another game model, and we find that the conclusions remain the same.