The 2016 presidential contest was the first real social-media election. Given the race’s often toxic and divisive rhetoric, it was a mixed blessing for the two giants of the industry.

Facebook Inc. and Twitter Inc. were central in the shaping of voters’ perceptions of the U.S. political climate and the two presidential candidates, Republican Donald Trump and Democratic rival Hillary Clinton. One in five social-media users modified their views about a political or social issue because of a social-media post, according to a...