MIX blatant bigotry with poor spelling. Add a dash of ALL CAPS. Top it off with a violent threat. And there you have it: A recipe for the worst of online comments, scourge of the Internet.

Blame anonymity, blame politicians, blame human nature. But a growing number of websites are reining in the Wild West of online commentary. Companies including Google and the Huffington Post are trying everything from deploying moderators to forcing people to use their real names in order to restore civil discourse. Some sites, such as Popular Science, are banning comments altogether.

The efforts put sites in a delicate position. User comments add a lively, fresh feel to videos, stories and music. And, of course, the longer visitors stay to read the posts, and the more they come back, the more a site can charge for advertising.

What websites don't want is the kind of off-putting nastiness that spewed forth under a recent CNN.com article about the Affordable Care Act.

"If it were up to me, you progressive libs destroying this country would be hanging from the gallows for treason. People are awakening though. If I were you, I'd be very afraid," wrote someone using the name "JBlaze."

YouTube, which is owned by Google, has long been home to some of the Internet's most juvenile and grammatically incorrect comments. The site caused a stir last month when it began requiring people to log into Google Plus to write a comment. Besides herding users to Google's unified network, the company says the move is designed to raise the level of discourse in the conversations that play out under YouTube videos.

One such video, a Cheerios commercial featuring an interracial family, met with such a barrage of racist responses on YouTube in May that General Mills shut down comments on it altogether.

Troll... Brit Reece Elliott was jailed for threatening to kill 200 people in a Facebook posting. Picture: AP

"Starting this week, when you're watching a video on YouTube, you'll see comments sorted by people you care about first," wrote YouTube product manager Nundu Janakiram and principal engineer Yonatan Zunger in a blog post announcing the changes. "If you post videos on your channel, you also have more tools to moderate welcome and unwelcome conversations. This way, YouTube comments will become conversations that matter to you."

Anonymity has always been a major appeal of online life. Two decades ago, The New Yorker magazine ran a cartoon with a dog sitting in front of a computer, one paw on the keyboard. The caption read: "On the Internet, nobody knows you're a dog." At its best, anonymity allows people to speak freely without repercussions. It allows whistle blowers and protesters to espouse unpopular opinions. At its worst, it allows people to spout off without repercussions. It gives trolls and bullies license to pick arguments, threaten and abuse.

But anonymity has been eroding in recent years. On the Internet, many people may know not only your name, but also your latest musings, the songs you've listened to, your job history, who your friends are and even the brand of soap you prefer.

"It's not so much that our offline lives are going online, it's that our offline and online lives are more integrated," says Mark Lashley, a professor of communications at La Salle University in Philadelphia. Facebook, which requires people to use their real names, played a big part in the seismic shift.

"The way the Web was developed, it was unique in that the avatar and the handle were always these things people used to go by. It did develop into a Wild West situation," he says, adding that it's no surprise that Google and other companies are going this route. "As more people go online and we put more of our lives online, we should be held accountable for things we say."

Nearly three-quarters of teens and young adults think people are more likely to use discriminatory language online or in text messages than in face to face conversations, according to a recent poll from The Associated Press-NORC Center for Public Affairs Research and MTV. The poll didn't distinguish between anonymous comments and those with real identities attached.

Huffington Post is also clamping down on vicious comments. In addition to employing 40 human moderators who sift through readers' posts for racism, homophobia, hate speech and the like, the AOL-owned news site is also chipping away at anonymous commenting. Previously, anyone could respond to an article posted on the site by creating an account, without tying it to an email address. This fall, HuffPo began requiring people to verify their identity by connecting their accounts to an email address.

"We are reaching a place where the Internet is growing up," says Jimmy Soni, managing editor of HuffPo. "These changes represent a maturing (online) environment."

This doesn't mean that people have to use their names when commenting. But Mr Soni says the changes have already made a difference in the quality of the comments. The lack of total anonymity, while not a failsafe method, offers people a "gut check moment," he says. There have been "significantly fewer things that we would not be able to share with our mothers," in the HuffPo comments section since the change, Mr Soni says.

Newspapers are also turning toward regulated comments. Of the largest 137 US newspapers - those with daily circulation above 50,000 - nearly 49 per cent ban anonymous commenting, according to Arthur Santana, assistant communications professor at the University of Houston. Nearly 42 per cent allow anonymity, while 9 per cent do not have comments at all.

Curbing anonymity doesn't always help. Plenty of people are fine attaching their names and Facebook profiles to poorly spelled outbursts that live on long after their fury has passed.

In some cases, sites have gone further. Popular Science, the 141-year-old science and technology magazine, stopped allowing comments of any kind on its news articles in September.

While highlighting responses to articles about climate change and abortion, Popular Science online editor Suzanne LaBarre announced the change and explained in a blog post that comments can be "bad for science."

Because "comments sections tend to be a grotesque reflection of the media culture surrounding them, the cynical work of undermining bedrock scientific doctrine is now being done beneath our own stories," wrote Ms LaBarre.

News.com.au's Privacy Policy includes important information about our collection, use and disclosure of your personal information (including to provide you with targeted content and advertising based on your online activities). It explains that if you do not provide us with information we have requested from you, we may not be able to provide you with the goods and services you require. It also explains how you can access or seek correction of your personal information, how you can complain about a breach of the Australian Privacy Principles and how we will deal with a complaint of that nature.

A NOTE ABOUT RELEVANT ADVERTISING: We collect information about the content (including ads) you use across this site and use it to make both advertising and content more relevant to you on our network and other sites.