The movie maestro is using the famous Cheddar Gorge as the backdrop for the sequel to his award-winning zombie flick 28 Days Later.
Locals in the Somerset village were cheesed off after the council shut its three loos.
But now Boyle, 67, has stepped in with the money used to pay for filming in the world famous location going to keep the toilets open.
One local said: “He’s a gentleman.”
Cash-strapped Somerset Council closed the three public toilets as part of a cost-cutting exercise in April – to the despair of locals and visitors alike.
Boyle’s production company, 28 Years Later Ltd, has already agreed a fee with Somerset County Council for the closure of the Gorge.
And it appears that pressure from businesses has meant that the money would be used to keep the loos open rather than disappear into the coffers of the county council with no benefit locally.
Derek Bradley-Balmer, chairman of Cheddar Parish Council said: “We understand the frustrations from businesses and tourists about the lack of toilets.
“The good news is the Dagd Hole toilet block up the gorge will remain open until September.
“There is a film production company that want to film around Cheddar Gorge and have offered a compensation payment to pay for our toilets.
“We can’t guarantee this, but they are in discussion with Somerset Council. However, this is not a long-term solution and we are looking at ways to solve this.”
Raymond Martin, managing director of the British Toilets Association said it’s a sorry state of affairs that someone like Danny Boyle has had to step in to keep the toilets open.
He said: “Good on Danny Boyle for ensuring that the toilets remain open in Cheddar Gorge and we applaud his intervention which will be welcome news to the half-a-million people who visit the area.
“But there is a bigger problem here and that is the funding of public toilets throughout the country.
“There is currently no legislation to ensure that public toilets are provided by councils – it is currently a discretionary service.
“Many councils, like Somerset, are having to cut back on services because of the chronic lack of government funding and we are now working with Westminster to try to establish a Commissioner responsible for public toilets who can ask councils for a strategy on what their area needs.”
A long-term solution is being thrashed out to ensure that the Gorge, which has more than half a million people flocking to its caves and walks, has public toilets.
The loss of the three loos in the village led to a petition.
While Boyle’s intervention has saved Dags Hole toilets in the short term, the other two blocks, at the Cliff Street car park and in the village centre on Station Road, remain closed.
Businesses in the village have continued to express “concern” about the lack of toilets to the council.
Dawn Farmer, who runs the Mousehole Café, said: “We’ve just had people coming constantly to use our toilets, 10 to 15 people were coming every half an hour.
“I didn’t mind to start with, but it’s unsustainable, so I was politely asking people if they’d buy something to contribute towards the cleaning costs.”