Abstract A dispersive liquid–liquid microextraction (DLLME) method has been optimised for simultaneously extracting 2,4,6-trichloranisole (TCA), 2,3,4,6-tetrachloroanisole (TeCA), 2,4,6-tribromoanisole (TBA), pentachloroanisole (PCA), 2,4,6-trichlorophenol (TCP), 2,3,4,6-tetrachlorophenol (TeCP), 2,4,6-tribromophenol (TBP) and pentachlorophenol (PCP) from wine. The haloanisoles and halophenols were automatically determined using a gas chromatography-electron-capture detection (GC-ECD) system. Derivatisation of halophenols was performed at the same time as DLLME. Firstly, disperser and extraction solvents, salt addition and temperature conditions were selected. Then, the volume of disperser solvent, extraction solvent and derivatisation agent, and the percentage of base were optimised by means of a central composite design combined with desirability functions. The optimal extraction–derivatisation conditions found were 1.3 mL of acetone, 150 μL of carbon tetrachloride, 75 μL of acetic anhydride and a percentage of base of 0.7%; with no salt addition and at room temperature. Under these conditions, the proposed method showed satisfactory linearity (with correlation coefficients over 0.994), repeatability (below 9.7%) and reproducibility (below 9.9%). Moreover, detection limits were lower than the olfactory threshold of the compounds. The developed method was successfully applied to the analysis of red wine samples. To our knowledge, this is the first time that DLLME has been applied to determine cork taint responsible compounds in wine.