BACKGROUND: Opsins are crucial for animal vision. The identity and function of opsins in Plutella xylostella remain unknown. The aim of the research is to confirm which opsin gene(s) contribute to phototaxis of P. xylostella.RESULTS: LW-opsin, BL-opsin and UV-opsin, were identified in the P. xylostella genome. LW-opsin was more highly expressed than the other two opsin genes, and all three genes were specifically expressed in the head. Three P. xylostella strains, LW-13 with a 13-bp deletion in LW-opsin, BL + 2 with a 2-bp insertion in BL-opsin, and UV-29 with a 5-bp insertion and a 34-bp deletion in UV-opsin, were established from the strain G88 using the CRISPR/Cas9 system. Among the three opsin-knockout strains, only male and female LW-13 exhibited weaker phototaxis to lights of different wavelengths and white light than G88 at 2.5 lx due to defective locomotion, and LW-13 was defective to sense white, green and infrared lights. The locomotion of LW-13 was reduced compared with G88 at 2.5, 10, 20, 60, 80, 100, and 200 lx under the green light, but the locomotion of LW-13 female was recovered at 80, 100 and 200 lx. The defective phototaxis to the green light of male LW-13 was not affected by light intensity, while the defective phototaxis to the green light of female LW-13 was recovered at 10, 20, 60, 80, 100, and 200 lx. CONCLUSION: LW-opsin is involved in light sensing and locomotion of P. xylostella, providing a potential target gene for controlling the pest.