Extracts of broccoli and banana may help in fighting stomach problems, research suggests.
Laboratory studies show fibres from the vegetables may boost the body's natural defences against stomach infections.
Trials are under way to see if they could be used as a medical food for patients with Crohn's disease.
Crohn's disease is an inflammatory bowel disease that causes symptoms such as diarrhoea and abdominal pain.
It affects about 1 in 1,000 people, and is thought to be caused by a mixture of environmental and genetic factors.
The condition is common in developed countries, where diets are often low in fibre and high in processed food.
Scientists at the University of Liverpool looked at how roughage from vegetables influenced the passage of harmful bacteria through cells inside the gut.
They found that fibres from the plantain, a type of large banana, and broccoli, were particularly beneficial. But a common stabiliser added to processed foods during the manufacturing process had the opposite effect.
Dr Barry Campbell, from the University of Liverpool, said: "This research shows that different dietary components can have powerful effects on the movement of bacteria through the bowel.
"We have known for some time the general health benefits of eating plantain and broccoli, which are both high in vitamins and minerals, but until now we have not understood how they can boost the body's natural defences against infection common in Crohn's patients.
"Our work suggests that it might be important for patients with this condition to eat healthily and limit their intake of processed foods."
The research, published in the journal Gut, and carried out in collaboration with experts in Sweden and Scotland, investigated special cells, called M-cells, which line the gut and ward off invading bacteria.
Work was carried out in laboratory-grown cells and tissue samples from patients undergoing surgery for stomach problems.
Clinical trials are now underway in 76 Crohn's patients to find out whether a medical food containing plantain fibres could help keep the disease at bay.
"It may be that it makes sense for sufferers of Crohn's to take supplements of these fibres to help prevent relapse," said Professor Jon Rhodes of the University of Liverpool.
Commenting on the study, a spokesperson for Crohn's and Colitis, which represents patients with inflammatory bowel disorders, welcomed further insight into how the gut combats bacteria like E.Coli.
"Knowledge of the M-cell role offers a more detailed explanation as to why a healthy diet can improve the health and well being for people with Crohn's disease and healthy individuals alike," she said.