The crumbly cheese beloved of TV duo Wallace and Gromit will soon help heat thousands of Yorkshire homes with renewable “green gas” made from cheese waste.

The Wensleydale Creamery has struck a deal to supply the waste whey from its cheese factory to a local bioenergy plant that produces enough renewable biogas to heat 4,000 homes. The Leeming biogas plant, which currently runs on ice-cream residue, will use a process called anaerobic digestion to turn the dairy-based waste into renewable biogas.

This process has been used since the 19th century to capture gases that are created naturally when food waste breaks down. Modern anaerobic digestion plants can inject the gas directly into the local gas grid, and can produce bio-fertiliser too. The project helps tackle a triple sustainability challenge for the UK by shrinking the carbon footprint of energy and reducing waste while helping to develop sustainable farming practices.

The latest bioenergy deal comes as the government prepares to carry out a major overhaul of the UK’s heating system to help cut carbon emissions to meet a 2050 target for a net-zero carbon economy. The Committee on Climate Change, the government’s official advisory body, has warned that food waste should not be allowed to sit in landfill, where it rots to produce carbon-rich methane.

Instead, unavoidable food waste should undergo anaerobic digestion to create a natural gas that can displace the fossil fuels used for heating or electricity generation. The net-zero carbon ambition will also require heavy carbon-cutting from manufacturers and farmers.

Wallace and Gromit, lovers of crumbly Wensleydale Cheese.

David Hartley, the managing director of the Wensleydale Creamery, said the project would bring sustainable environmental and economic benefits to the region. He said: “The whole process of converting local milk to premium cheese and then deriving environmental and economic benefit from the natural by-products is an essential part of our business plan as a proud rural business.”

The firm produces 4,000 tonnes per annum of the cheese – which was awarded protected status by the EU in 2013 – at its dairy in Hawes in the heart of the Yorkshire Dales.

The Leeming bioenergy plant is one of nine across Yorkshire owned by sustainability investor Iona Capital, which estimates that it saves the equivalent of 37,300 tonnes of carbon emissions every year.

Mike Dunn, Iona’s co-founder, said: “Once we have converted the cheese by-product supplied by Wensleydale into sustainable green gas, we can feed what’s left at the end of the process on to neighbouring farmland to improve local topsoil quality. This shows the real impact of the circular economy and the part intelligent investment can play in reducing our carbon emissions.”

The nearby R&R Ice-cream factory, maker of the Cadbury’s Flake and Nobbly Bobbly treats, also supplies the bioenergy plant with residual ice-cream leftover after cleaning its tanks.

Iona Capital has another two anaerobic digestion projects in the pipeline, Dunn said.