Social-media companies that have spent months pledging to bolster their defenses against the spread of misinformation through their platforms ahead of this year’s presidential election are about to get a first big test, the U.S. census.

Facebook Inc. and Google parent Alphabet Inc. have barred ads containing inaccurate information about the decadal count of people living in the U.S. that starts this month. They also have said they would prohibit content designed to spread misinformation about the time, means or eligibility requirements for participating in the process.

Twitter Inc. and Reddit Inc. have started working with nonprofits and others to help ensure information on their platforms doesn’t discourage people from participating.

The U.S. Census Bureau has set up a trust-and-safety team to protect the integrity of the count. That team, it said, was working with the social-media companies and others to combat false and misleading information.

Stephen Buckner, assistant director of communications for the Census Bureau, has said the agency is worried that foreign or domestic individuals or groups that he didn’t otherwise identify may try using social networks to deter people from participating in the census. The companies have pledged to quickly deal with posts the agency’s team identifies as potentially harmful to the count.