Social media giants Facebook (FB) - Get Report , Twitter (TWTR) - Get Report , Google's (GOOG) - Get Report , Youtube and Microsoft (MFST) have pledged to fight online hate speech in Europe, agreeing a new code of conduct with the Brussels-based European Commission.

As part of the code, the companies said they will review requests for removing illegal hate speech within 24 hours and remove or disable access to the content, if necessary.

They also promised to educate and raise awareness with their users about the types of content not permitted under their rules and community guidelines, and to share best practices with each other and with other platforms and industry peers.

"The recent terror attacks have reminded us of the urgent need to address illegal online hate speech," said Vera Joruova, the EU Commissioner for Justice, Consumers, and Gender Equality, in a statement Tuesday, warning that social media is used by terrorist groups to radicalize young people and racists use to spread violence and hatred.

"This agreement is an important step forward to ensure that the internet remains a place a free and democratic expression, where European values and laws are respected," Jourova added.

Monika Bickert, head of global policy management at Facebook, which has 1.6 billion users worldwide, said "there's no place for hate speech on Facebook," and that "our teams around the world review these reports around the clock and take swift action."

And Karen White, Twitter's head of public policy for Europe, said that while the company remains committed to "letting the Tweets flow," and that "there is a clear distinction between freedom of expression and conduct that incites violence and hate."

Facebook was up 0.39% in pre-market trading this morning. The stock closed $119.38 on Friday. Twitter was recently up 0.33% in the pre-market session, it closed at $15.05.

(Facebook and Twitter are held in Jim Cramer's charitable trust Action Alerts PLUS. See all of his holdings here.)