Physics-informed neural network (PINN) provides an effective way to learn numerical solutions of partial differential equations (PDEs) in the sampling domain, but usually shows poor performances beyond the domain from which the training points are sampled, i.e., the limited solution extrapolation ability. In this paper, we propose a symmetry-enhanced physics-informed neural network (sePINN) to improve the extrapolation ability which incorporates the symmetry properties of PDEs into PINN. Specifically, we first explore the discrete and continuous symmetry groups of the PDEs under study, and then leverage them to further constrain the loss function of PINN to enhance the solution extrapolation ability. Numerical results of the sePINN method with different numbers of collocation points and neurons per layer for the modified Korteweg-de Vries equation show that both the accuracies of solutions in and beyond the sampling domain are improved concurrently by the proposed sePINN method.In particular, the accuracies of extrapolated solutions take a tendency of flat fluctuations with, even superior to, the ones of solutions directly trained via the PINN method.