Coconut free fatty acid (CFFA), a mixture of 8 fatty acids derived from coconut oil, is an effective repellent and deterrent against a broad array of hematophagous insects. In this study, we evaluated the oviposition deterrent activity of CFFA on spotted-wing drosophila (SWD; Drosophila suzukii), a destructive invasive pest of berries and cherries, and identified bioactive key-deterrent compounds. In laboratory 2-choice tests, CFFA deterred SWD oviposition in a dose-dependent manner with the greatest reduction (99%) observed at a 20-mg dose compared with solvent control. In a field test, raspberries treated with 20-mg CFFA received 64% fewer SWD eggs than raspberries treated with the solvent control. In subsequent laboratory bioassays, 2 of CFFA components, caprylic and capric acids, significantly reduced SWD oviposition by themselves, while 6 other components had no effect. In choice and no-choice assays, we found that a blend of caprylic acid and capric acid, at equivalent concentrations and ratio as in CFFA, was as effective as CFFA, while caprylic acid or capric acid individually were not as effective as the 2-component blend or CFFA at equivalent concentrations, indicating the 2 compounds as the key oviposition deterrent components for SWD. The blend was also as effective as CFFA for other nontarget drosophilid species in the field. Given that CFFA compounds are generally regarded as safe for humans, CFFA and its bioactive components have potential application in sustainably reducing SWD damage in commercial fruit operations, thereby reducing the sole reliance on insecticides.