Existing location-based services have collected a large amount of location data, which contain users’ personal information and has serious personal privacy leakage threats. Therefore, the preservation of individual privacy when publishing data is receiving increasing attention. Most existing methods of preserving user privacy suffer a serious loss in data usability, resulting in low usability of data. In this paper, we address this problem and present TOPF, a novel approach for preserving privacy in trajectory data publishing based on frequent path. TOPF aims to achieve better quality of trajectory data for publishing and strike a balance between the conflicting goals of data usability and data privacy. To the best of our knowledge, this is the first paper that uses frequent path to preserve data privacy. First, infrequent roads in each trajectory are removed, and a new way is adopted to divide trajectories into candidate groups. A new method for finding the most frequent path is then proposed, and then, the representative trajectory is selected to represent all trajectories within a group. Experimental results show that our algorithm not only effectively guarantees the privacy of the user but also ensures the high usability of the data.