Social media giants Twitter and Facebook are working on plans to update how they handle hate speech on their platforms after mounting scrutiny from civil rights groups.

Twitter is expanding its hateful conduct policy to prohibit language that “dehumanizes people on the basis of race, ethnicity, or national origin,” the company announced Wednesday.

Posts with such language may be removed from Twitter if reported, and users who repeatedly break the rule may have their accounts temporarily locked or suspended.

The update expands the company’s hateful conduct policy, which previously included prohibiting language that dehumanizes others on the basis of religion or caste, as well as on the basis of age, disability or disease.

Facebook is also updating how it handles hate speech online, a company spokesperson confirmed to The Hill.

The company is overhauling its algorithm that detects hate speech as part of a project first reported by The Washington Post on Thursday.