This paper presents a learning algorithm of Hopfield neural network based on evolutionary programming with forgetting. The algorithm can avoid local minima by forgetting some individuals. Under constraints of fixed points, limit cycles or iteration sequences, the algorithm simultaneously acquires both the topology and weights for Hopfield neural network by solving inequalities. It copes with the limitations of evolving Hopfield learning algorithm. It can also find several optimal solutions. The experimental results also demonstrate the effectiveness of the algorithm.