A microwave mixer based on a tunable microwave photonic filter is presented and experimentally demonstrated. The tunable microwave photonic filter consists of a broadband optical source and a dual-parallel Mach–Zehnder modulator employing a variable optical carrier time-shift method. The central frequency of the tunable single-passband filter can be tuned by adjusting an optical variable delay line. The filter can select the wanted mixing components and suppress the other mixing spurs. Experiments are performed and the results show that the out-of-band rejection ratio of the filter is over 45 dB. The up-converted and down-converted signals are successfully selected, and the unwanted mixing spurs are effectively suppressed.