The State Department will publish new rules this week to require most visitors and immigrants to the U.S. to divulge their recent social media histories, carrying out one of the key security enhancements from President Trump’s extreme vetting executive order. Travelers would also be asked to list phone numbers, email addresses and international travel during the previous five years, and to detail any immigration problems they have had, whether with the U.S. or elsewhere. They also will be asked about potential family connections to terrorism.

The Homeland Security Department had floated plans to track social media of immigrant applicants, but the State Department’s proposal would apply to tourists and others coming on temporary visas. Some 14 million people would be affected by the request for information tied to visitors’ visas, and about 700,000 others would be affected in the immigration system, the department said in the documents.

Don Crocetti, a former senior fraud investigator for U.S. Citizenship and Immigration Services, said it makes sense to collect the information but that officers need to stay within privacy rules too. He said in the immigration context, looking at social media can help an adjudicator assess whether the story the applicant is telling in applying for a benefit rings true — such as in the case of a marriage petition. But Mr. Crocetti said someone’s refusal to turn over the passwords or other nonpublic social media information can’t be used on its own to deny approval.

“The use of social media is a wrench in their toolbox. It’s not that you use that same wrench for everything you do, but it’s a wrench, it’s a different-sized tool, and you have use that selectively,” he said. The State Department said it already collects limited information about travel history and family relations. The new information will go beyond that to include prior passport numbers, information about family members and a longer history of travel, employment and contact information.

“Collecting this additional information from visa applicants will strengthen our process for vetting these applicants and confirming their identity,” the department said. Ms. Vaughan said she wished the State Department had also requested information on the visitor application about whether female travelers are intending to enter the U.S. for the purpose of having a child. She said that could cut down on “birth tourism,” in which women in the late stages of pregnancy visit the U.S. in order to give birth on American soil, securing citizenship for the child.