The singer, who impressed fans when he made it to the Boot Camp stage of the programme before being controversially eliminated, sang to pupils at the Charlton School, in Wellington.
The concert was organised to raise money in memory of former pupil Annie-May Johnson, who had died the previous year, aged 11.
Whelan, from Wolverhampton, performed to hundreds of Year 8 and 9 pupils at the school, in Severn Drive.
He had been tipped as a favourite among viewers on X Factor after performing Led Zeppelin’s Whole Lotta Love in his first audition.
However he criticised the show after losing out to Essex boy Rylan Clark at Boot Camp. Rylan, of course, went on to be one of the show's big successes, as television presenter and disc jockey Rylan Clark-Neal, although he wasn't actually the eventual winner of the competition – the winner that year was James Arthur.
Whelan's axe had prompted fan protests and a Facebook campaign to have him brought back to the show.
Theresa Alexander, head of Year 8, said at the time of his Charlton concert that Annie-May’s fellow pupils wanted to do something in her memory and hoped to buy a bench for the school grounds.
However the youngsters were finding it difficult to raise the money.
“Joseph Whelan said he would do a free concert as long as it was in aid of charity. We are raising money for a bench in memory of Annie-May at the school so it seemed a good reason to get him to come here. Any money left over will go to the Diana, Princess of Wales Children’s Hospital in Birmingham,” she said.
They hoped to have raised nearly £400 after charging pupils to watch the gig.
They hoped, she said, to have the bench in place before the end of the spring term.
Miss Alexander described Whelan’s visit as "fantastic" and said the youngsters had been very excited when they realised who was visiting the school.
Around 500 pupils in Year 8 – Annie-May’s classmates – and Year 9 enjoyed the show, which was followed by a question and answer session.
“It was brilliant. He was here for about two hours in total. He played for about half an hour and for the last 15 minutes he had his photograph taken with pupils. There was such a massive queue for him.”
The youngsters were treated to renditions of U2’s With or Without You, Bon Jovi’s Always, Ed Sheeran’s Lego House and Leonard Cohen’s Hallelujah as well as Whelan’s own composition, Surrender.
Miss Alexander said: “There was a very positive response and I am really chuffed with how it went. He went down very well with the kids and was brilliant.”
Annie-May had died at the children’s hospital from heart failure after suffering a brain haemorrhage.
She had been diagnosed with hydrocephalus – fluid on the brain – at the age of 10 after the problem was spotted during a routine eye test. She had emergency surgery and was thought to have made a full recovery.
Before her death, Annie-May held a coffee morning and raised £803 for the Association for Spina Bifida and Hydrocephalus.
Whelan, a former cage fighter, was already a veteran performer by the time he entered the X Factor competition. In 2012 he released a single called "I Lie Lonely."
After his axe from the show he said: “The X Factor set me up for a fall. They shafted me by praising me so highly – then sending me home.
“I nailed all three of my performances and didn’t get one negative comment from the judges. So I was in complete shock when they kicked me out."
Nevertheless he had another go at X Factor in 2013, but was rejected a second time, this time at the Judges' Houses stage. Sharon Osbourne opted to pick Sam Bailey – the eventual winner – Lorna Simpson and Shelley Smith for her final three in the live shows.
Despite positive support from Osbourne's guest mentor Robbie Williams, Whelan didn't make the cut.
The old Charlton School where Whelan performed on that day seven years ago no longer exists. The last lessons were held there on May 26, 2016. After the half term break it reopened at a new site not far away, where the old BRJ school had been. Demolition began of the old Charlton buildings in October 2016.