For four years they have been campaigning for the ice cream containers to be redesigned to help protect the animals.
Hedgehogs have been tempted into discarded tubs by the smell of the dessert, only to become trapped and ending up dying of starvation.
There have been several incidences in the Lothians since 2002, which have prompted a national campaign led by the British Hedgehog Preservation Society and backed by the Scottish SPCA.
In 2002, McDonald's agreed to look into redesigning the McFlurry cup after ten hedgehogs needed treatment at the SSPCA's Middlebank Wildlife Centre in Dunfermline.
Now they have come up with a new lid for their cartons which will have a hole big enough to get ice cream out of, but too small for a hedgehog to crawl though.
The new lids are set to be rolled out at fast food outlets across Europe.
The British Hedgehog Preservation Society (BHPS) warned about the problem in a recent newsletter. "In the hot weather we have been having, more ice cream is sold, and hedgehogs are desperate for food as the ground is hard and natural food is scarce," it said.
"Unfortunately we also get reports of hedgehogs found dead with heads stuck in McFlurry containers, and we can only guess the amount that are never found and die a slow death in a secluded spot."
Today, Fay Vass, spokeswoman for BHPS, said: "Apparently McDonald's are delivering the lids into their restaurants this week, so they should be in use by September.
"It's been a very long campaign, we've been pushing for five years, which is far too long, but we're very glad that the changes seem to be happening." A spokeswoman for McDonald's said: "McDonald's have undertaken significant research and testing to develop new packaging for our McFlurry dessert that addresses this issue.
"The smaller aperture of the lid has been designed to prevent hedgehogs from entering the McFlurry container in the unfortunate incidence that a lid is littered and is then accessible to wildlife.
"New lids were delivered into all UK restaurants as of Monday, August 21. Our restaurants and packaging will continue to display anti-littering messaging to encourage our customers to dispose of their litter responsibly, and we conduct daily litter patrols whereby we collect not only McDonald's packaging but also any other litter that has been carelessly discarded."
The move has been welcomed by the SSPCA.
A spokeswoman said: "In the last few months, members of the public have discovered a couple of hedgehogs trapped in McFlurry lids, but have been talked through how to release them.
"We do have lots of animals that are affected by litter - ring-pulls are the worst. We frequently have to treat animals who have been eating discarded paper and plastic bags. The BHPS are the hedgehog experts, so if McDonald's are responding to their concerns and doing something about it, we're really pleased."