You will still be allowed hate speech in the US so the central platform of the Trump campaign is still safe but those who try to copy his strategy in the EU might become a little unstuck.
EU governments have been trying in recent months to get social platforms to crack down on rising online racism following the refugee crisis and terror attacks, with some even threatening action against the companies.
As part of the pledge agreed with the European Commission, the web giants will review the majority of valid requests for removal of illegal hate speech in less than 24 hours and remove or disable access to the content if necessary.
They will also strengthen their cooperation with civil society organizations who help flag hateful content when it goes online and promote “counter-narratives” to hate speech.
EU Justice Commissioner Vera Jourova said: “The recent terror attacks have reminded us of the urgent need to address illegal online hate speech. Social media is unfortunately one of the tools that terrorist groups use to radicalise young people.”
Germany got Google, Facebook and Twitter to agree to delete hate speech from their websites within 24 hours last year and even launched an investigation into the European head of Facebook over its alleged failure to remove racist hate speech.
The code of conduct is largely a continuation of efforts that the companies already take to counter hate speech on their websites, such as developing tools for people to report hateful content and training staff to handle such requests.
Twitter has suspended over 125,000 accounts since the middle of 2015 for threatening or promoting terror acts, primarily related to Islamic State.
EU ministers had called for cooperation with tech companies to be stepped up after the Brussels attacks in March.