The hydrophobic ionic liquid, \[BMIM\]\[BF6\] was synthesized, and the treatment conditions were investigated. When the extraction ratio is 1∶5, and pH=5, after 15min, the oil removal ratio is 95.6% and the CODCr removal is 93.5%. At the same time, the recovery of ionic liquids experiment was carried out. By the recovery ionic liquid, the oil and CODCr removal were 95.4%and 93.2% respectively, the results showed that ionic liquid can be regenerated and the effects are not reduced. The results indicate that the hydrophobic ionic liquids can remove the oil and organic compounds in the oilfield wastewater effectively. And the mechanism of ionic liquids was proposed.