Seismic wavefield modeling based on the wave equation is widely used in understanding and predicting the dynamic and kinematic characteristics of seismic wave propagation through media. This article presents an optimal numerical solution for the seismic acoustic wave equation in a Hamiltonian system based on the third‐order symplectic integrator method. The least absolute truncation error analysis method is used to determine the optimal coefficients. The analysis of the third‐order symplectic integrator shows that the proposed scheme exhibits high stability and minimal truncation error. To illustrate the accuracy of the algorithm, we compare the numerical solutions generated by the proposed method with the theoretical analysis solution for 2D and 3D seismic wave propagation tests. The results show that the proposed method reduced the phase error to the eighth‐order magnitude accuracy relative to the exact solution. These simulations also demonstrated that the proposed third‐order symplectic method can minimize numerical dispersion and preserve the waveforms during the simulation. In addition, comparing different central frequencies of the source and grid spaces (90, 60, and 20 m) for simulation of seismic wave propagation in 2D and 3D models using symplectic and nearly analytic discretization methods, we deduce that the suitable grid spaces are roughly equivalent to between one‐fourth and one‐fifth of the wavelength, which can provide a good compromise between accuracy and computational cost.