Men trying to improve their sperm count can ditch the healthy living advice but should think carefully about their underwear, doctors have found.

Smoking, drinking alcohol, using recreational drugs and being overweight are all listed in National Institute of Clinical Excellence (NICE) guidelines as factors likely to harm male fertility. But research has found they make little difference – with one exception. Changing underwear style could improve a man's chances of having a baby.

"There is no need for men to become monks just because they want to be a dad," said Allan Pacey, senior lecturer in andrology at the University of Sheffield, who was involved in the study.

"But if they are a fan of tight Y-fronts, then switching underpants to something a bit looser for a few months might be a good idea."

To make healthy sperm, the testicles need to be a degree or two below body temperature, which is why evolution has seen to it that they hang outside in their own sac, where it's cooler. Tight Y-fronts risk reversing what millions of years of evolution have achieved.

The researchers from the Universities of Manchester and Sheffield compared some 900 men with low sperm counts with 1,300 who had high sperm counts. They found drugs, tobacco, alcohol and weight had little effect. But boxer shorts did. Dr Andrew Povey, from the University of Manchester's School of Community Based Medicine, said: "This potentially overturns much of the current advice given to men about how they might improve their fertility and suggests that many common lifestyle risks may not be as important as we previously thought.

"Delaying fertility treatment for these couples so that they can make changes to their lifestyles, for which there is little evidence of effectiveness, is unlikely to improve their chances of a conception and, indeed, might be prejudicial for couples with little time left to lose."

The findings are published in the journal Human Reproduction. The researchers found that the proportion of men who had low numbers of swimming sperm was similar whether they had never been a smoker or were smoking more than 20 cigarettes a day. Similarly, there was little evidence of any risk associated with alcohol consumption.

Infertility was most strongly linked with having had previous testicular surgery, being of black ethnicity or working in a manual occupation.