In social insects, grooming is considered as a behavioral defense against pathogen and parasite infections since it contributes to remove microbes from their cuticle. However, stimuli which trigger this behavior are not well characterized yet. We examined if activating contact chemoreceptive sensilla could trigger grooming activities in Drosophila melanogaster. We monitored the grooming responses of decapitated flies to compounds known to activate the immune system, e.g., dead Escherichia coli (Ec) and lipopolysaccharides (LPS), and to tastants such as quinine, sucrose, and salt. LPS, quinine, and Ec were quite effective in triggering grooming movements when touching the distal border of the wings and the legs, while sucrose had no effect. Contact chemoreceptors are necessary and sufficient to elicit such responses, as grooming could not be elicited by LPS in poxn mutants deprived of external taste sensilla, and as grooming was elicited by light when a channel rhodopsin receptor was expressed in bitter-sensitive cells expressing Gr33a. Contact chemoreceptors distributed along the distal border of the wings respond to these tastants by an increased spiking activity, in response to quinine, Ec, LPS, sucrose, and KCl. These results demonstrate for the first time that bacterial compounds trigger grooming activities in D. melanogaster, and indicate that contact chemoreceptors located on the wings participate in the detection of such chemicals.