BackgroundZeugodacus cucuribitae is a major agricultural pest that causes significant damage to varieties of plants. Vision plays a critical role in phototactic behavior of herbivorous insects. However, the effect of opsin on the phototactic behavior in Z. cucuribitae remains unknown. The aim of this research is to explore the key opsin genes that associate with phototaxis behavior of Z. cucurbitae.ResultsFive opsin genes were identified and their expression patterns were analyzed. The relative expression levels of ZcRh1, ZcRh4 and ZcRh6 were highest in 4‐day‐old larvae, ZcRh2 and ZcRh3 were highest in 3rd‐instar larvae and 5‐day‐old pupae, respectively. Furthermore, five opsin genes had the highest expression levels in compound eyes, followed by the antennae and head, whereas the lower occurred in other tissues. The expression of the long‐wavelength‐sensitive (LW) opsins first decreased and then increased under green light exposure. In contrast, the expression of ultraviolet‐sensitive (UV) opsins first increased and then decreased with the duration of UV exposure. Silencing of LW opsin (dsZcRh1, dsZcRh2, and dsZcRh6) and UV opsin (dsZcRh3 and dsZcRh4) reduced the phototactic efficiency of Z. cucurbitae to green light by 52.27%, 60.72%, and 67.89%, and to UV light by 68.59% and 61.73%, respectively.ConclusionThe results indicate that RNAi inhibited the expression of opsin, thereby inhibiting the phototaxis of Z. cucurbitae. This result provides theoretical support for the physical control of Z. cucurbitae and lays the foundation for further exploration of the mechanism of insect phototaxis. © 2023 Society of Chemical Industry.