We propose and demonstrate an all optical wavelength conversion of Nyquist differential phase 16 quadrature amplitude modulation based on microwave photonics signal processing for flex‐grid optical networks. By analyzing the mechanism of the microwave photonics and adjusting the parameters of the components, multi‐wavelength tunable laser with smooth and adjustable optical intensity can be obtained. Then, the multi‐channel photonic signals with the minimal guard space of 5 GHz can be obtained, which provide more than 20 flex‐grids for optical transmission with transparent rate and format. The optical power of converted wavelengths, optical signal‐to‐noise ratio, error vector magnitude, and bit error rate (BER) are studied under the condition of different flex‐grids, the frequencies of which are from 15 GHz to 36 GHz. The channel frequency spacing and amplitude of the converted wavelength can be dynamically adjusted via parameter configuration. Flex‐grid spacing strategies and channel selecting strategies are given. The BER performance of all converted channels can fall below the forward error correction threshold of 3.8 × 10−3 by optimizing the optical power of the receiver end. The results show the tradeoff between the BER and the detected optical power of the receiver end. These research findings could provide solutions for spectrum allocation and routing selection when wavelength conversion is needed in optical links.