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 on online comment threads. (Damian Dovarganes/AP)

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, politicians, human nature. But a growing number of Web sites are reining in the Wild West of online commentary. Companies such as Google and the Huffington Post are trying everything from deploying moderators to forcing people to use their real names to try 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 Web sites 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 onto 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.

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.

The Huffington Post is also clamping down on vicious comments. The AOL-owned news site said it employs 40 human moderators who sift through readers’ posts for racism, homophobia, hate speech and the like. It also is 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 e-mail address. This fall, the Huffington Post began requiring people to verify their identity by connecting their accounts to an e-mail address, but that didn’t appear to be enough. The site now also asks commenters to log in using a verified Facebook account.

“We are reaching a place where the Internet is growing up,” said Jimmy Soni, managing editor of the Huffington Post. “These changes represent a maturing [online] environment.”

Newspapers are also turning toward regulated comments. Of the largest 137 U.S. newspapers — those with daily circulation above 50,000 — nearly 49 percent ban anonymous commenting, according to Arthur Santana, assistant communications professor at the University of Houston. Nearly 42 percent allow anonymity, while 9 percent 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,” LaBarre wrote.

— Associated Press