New Delhi: Social media platforms like Facebook, Twitter and WhatsApp have agreed to follow the "voluntary code of ethics" in all future elections, including the upcoming Maharashtra and Haryana assembly polls, the Election Commission said on Thursday.