Wavelength division multiplexing (WDM) mesh-based optical network on chip (ONoC) have recently received considerable attention due to their regular topology and higher throughput. However, available wavelengths are finite resources. Thus, to minimize the number of wavelengths, this letter proposes an efficient WDM mesh-based ONoC mapping approach, which is based on a particle swarm optimization algorithm. Experimental results reveal that our proposal has a positive effect in minimizing the number of wavelengths needed compared to random mapping. The tradeoff between the number of wavelengths and the network size is also investigated, and it is found that increasing the network size can reduce the number of wavelengths needed. Meanwhile, the experiments show that the structure has better network performance and less communication resource utilization.