Image copyright ITV/REX/Shutterstock Image caption Jack Maynard has 1.2 million subscribers on YouTube

YouTube star Jack Maynard and rapper Stormzy are the latest celebrities to discover that ill-judged and offensive things they said years ago on social media can come back to damage their reputations and possibly their careers.

Virtually every celebrity breaking through today - certainly all those who are as big on YouTube as Jack Maynard is - will owe at least part of their success to social media.

But, as Maynard has discovered, living your life online means opinions you expressed years ago can resurface when you least expect it.

Like when you're in the Australian jungle.

The 22-year-old, whose funny videos have attracted 1.2 million subscribers to his YouTube channel, was kicked off I'm A Celebrity... Get Me Out Of Here on Tuesday. That was after a series of tweets, most of which date from 2011-13, came to light.

Maynard was between 16 and 19 at the time. In the offending messages, he used homophobic language and referred to friends using the n-word.

His representative has said he is "ashamed" of the posts and realises the language was "completely unacceptable".

Image copyright Getty Images Image caption Stormzy said he had expressed views "that I've unlearned as I've grown up and become a man"

Many fans and members of the vlogging community have leapt to his defence.

Meanwhile, some viewers have wondered why Maynard was singled out when questionable tweets from fellow I'm A Celeb contestant Amir Khan have emerged - and the show let the outspoken Katie Hopkins stay a decade ago.

She has voiced her support, writing: "Dear @Jack_Maynard23 - they kept me in, my love. You're an angel by comparison. It's all just noise. Breathe quiet air."

ITV hasn't confirmed why he was removed from the reality show - there have also been reports that he was axed because he sent private messages asking a 14-year-old girl for photos of her in her bra, when he was aged 16.

She has told The Sun he didn't know how old she was at the time.

ITV told the BBC they had no comment on the reports and Maynard's spokespeople have not yet given a response.

He is one of a number of celebrities whose unsavoury public remarks have recently been dredged up.

Stormzy apologised on Wednesday for using homophobic tweets between 2011 and 2014.

He says they were views "that I've unlearned as I've grown up and become a man". He's 24 now.

And last week, vlogging queen Zoella apologised for a number of old tweets about gay people and "chavs".

The posts were from 2009-12, when she was around 19-22. She said she "would never say those things now".

Image copyright PA

But can such comments be explained away by youthful ignorance and the passage of time?

In a highly personal column, The Sun newspaper's showbiz editor Dan Wootton recounted how he was bullied at school by people using the same language as Maynard had tweeted.

Wootton said "I feel deeply sorry for the millennial generation whose every utterance from their earliest years is archived on the internet.

"But that's not what this situation is all about."

Using such words "was completely unacceptable long before the invention of Twitter, as Jack learned the hard way", he added.

The thing Maynard, Stormzy and Zoella's tweets all had in common was that they all featured homophobic insults.

Image copyright Getty Images Image caption Maynard is the younger brother of pop star Connor

A spokesperson for LGBT rights group Stonewall said: "It's important that homophobic abuse and slurs are called out. People need to understand that this sort of language is, and always will be, deeply damaging and harmful.

"We also know people can and do change. At Stonewall our mission is to get people to understand the impact that discriminatory attitudes and abusive words have on lesbian, gay, bi and trans people."

And Sarah Davis, a PR manager and fashion blogger, was among those criticising him on Twitter.

David Levin, co-founder of social media agency That Lot, says celebrities should be cut some slack for saying things when they were "young and daft".

"But there's a limit," he says. "Most 10-year-olds would know it's wrong to say something sexist, racist or homophobic. And the fact that they tweeted it makes it worse.

"Celebrities need to realise that journalists are probably trawling through their social feeds right now. And that stupid thing you tweeted is gonna bite you on the arse."

There's one exception, of course: "Unless you happen to be the President of the United States."

Mr Levin has written tweets on behalf of high-profile personalities as well as brands and broadcasters.

"If a high profile individual is about to be in the spotlight for whatever reason, they're encouraged to look back through their feeds and discreetly remove anything that may be taken, or reported, the wrong way out of context," he says.

"Or in more extreme cases, deleted immediately because it was a stupid thing to say."

Growing up in public

PR guru Mark Borkowski says Jack Maynard's actions highlight that there's nowhere to hide for the generation who have grown up on social media.

"Perhaps it proves a degree of abject ignorance and arrogance," he says.

"Past attitudes and social hubris will haunt many, many celebrities who now attempt to plunder celebrity status. They will reach the realisation that fame is toxic fame."

And it shows your social history can be dredged up by anybody - be they journalists or HR people deciding on jobs in other walks of life.

"I tell my own kids, 'Be careful what you post,'" he says. "And I think kids are pretty savvy about it now, and I think this is a fantastic lesson for anybody of the millennial generation to learn that your life is no longer your own."

Follow us on Facebook, on Twitter @BBCNewsEnts, or on Instagram at bbcnewsents. If you have a story suggestion email entertainment.news@bbc.co.uk.