Failing to do so, the government said, would cause social media platforms to be in violation of law and lose safe harbour protection.