Six months after YouTube was caught in a firestorm for refusing to take down videos from a conservative commentator who repeatedly lobbed racist and homophobic slurs at a journalist, the video giant says it is taking a “stronger stance” against threats and personal attacks.

The company announced Wednesday that it will remove videos that insult people based on “protected attributes” such as race, gender expression or sexual orientation. It also is broadening its anti-harassment policies to include “veiled or implied threats,” including content that suggests violence toward an individual.

“This applies to everyone,” Matt Halprin, YouTube’s head of trust and safety, said in a blog post, “from private individuals, to YouTube creators, to public officials.” The changes apply to comments as well as videos.

A YouTube spokesman told The Washington Post that videos or comments that were posted prior but violate the new policies will still be removed but that individuals will not be penalized for them. The policies take effect Wednesday, but YouTube expects enforcement and removals to ramp up gradually in coming months.

Google’s YouTube has frequently come under fire for lax enforcement of racist content, be it virulent Islamophobia from the mouth of a 14-year-old, or white supremacist or horrific images spliced into innocuous-seeming kids’ videos. Gradually — and after extensive scrutiny from media, lawmakers and advocacy groups — YouTube has been working to clean up the platform. In June, it banned supremacist and extremist content and removed thousands of channels, but a September report from the Anti-Defamation League found dozens of channels promoting these beliefs remained on the platform. It’s also tried to crack down on misinformation through changes to its recommendation engines.

Some of the changes stem from YouTube’s pledge in July to crack down on “creator-on-creator harassment” after the fierce criticism it attracted for not removing videos from Steven Crowder. The right-wing commentator and comedian frequently insulted Vox video producer Carlos Maza — who is gay and of Cuban descent — for his sexual orientation and race. Fed up, Maza created a supercut of epithets Crowder had hurled at him over the years, including calling him a “lispy sprite,” an ” angry little queer,” “gay Mexican” and “Mr. Lispy queer from Vox.”

After the tweet when viral, YouTube investigated Crowder’s videos but ultimately decided they didn’t violate its policies, which explicitly forbid hate speech, stereotypes that promote hatred and content that “is deliberately posted in order to humiliate someone.” Because Crowder’s insults about Maza were just a small part of videos about other things, they were fair game, the platform said.

“It seems to me to be a clear violation of that policy,” Maza told The Post at the time. “I understand that speech always involves gray areas, but that it’s hard to enforce hate speech policies should not distract from the fact that it’s sometimes extremely clear-cut. And this seems to be one of those cases.”

YouTube changed course the following day and moved to demonetize Crowder’s videos by not allowing him to run ads on them. The company declined to explain its decision.

The new policies specifically address hateful campaigns such as Crowder’s by looking for harassment levied across multiple videos or comments, even if they don’t violate policies on an individual basis. YouTube will tighten standards for its partner program, which allows content creators to make money off ads on their videos.

“Channels that repeatedly brush up against our harassment policy will be suspended from [the partner program], eliminating their ability to make money on YouTube,” Halprin wrote. “We may also remove content from channels if they repeatedly harass someone. If this behavior continues, we’ll take more severe action including issuing strikes or terminating a channel altogether.”

YouTube is expanding a tool that lets creators review comments before they appear beneath their videos. It’s already been turned on by default for many bigger channels and will be available for “most” by the end of the year, though creators can opt out if they choose. The company said it expects this to lead to an uptick in comments being removed; it said it took down more than 16 million in the third quarter of 201

The policy changes will make enforcement more challenging, as YouTube — like all social media outlets — continues to wrestle with its role in protecting users while upholding the tenets of free speech.

“There’s a lot of nuance and context that’s important here, but it is really something we want to get right on our platform,” Neal Mohan, YouTube’s chief product officer, told the New York Times in an interview before the announcement. “We don’t want this to be a place where individuals are harassed. We want to take a clear line about that.”