NEW YORK - 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.

But a growing number of websites are reining in the Wild West of online commentary. Companies including Google and 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. The company says the move is designed to raise the level of discourse in the conversations that play out under YouTube videos.

Anonymity has always been a major appeal of online life. At its best, anonymity allows people to speak freely without repercussions. At its worst, it allows people to spout off without repercussions. It gives trolls and bullies license to pick arguments, threaten and abuse.

"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," said Mark Lashley, a professor of communications at La Salle University.

The 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. This fall, Huffington Post began requiring people to verify their identity by connecting their accounts to an e-mail address.

"We are reaching a place where the Internet is growing up," says Jimmy Soni, managing editor of 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.

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.