President Donald Trump speaks during a news conference with Swedish Prime Minister Stefan Lofven in the East Room of the White House, Tuesday, March 6, 2018, in Washington. (AP Photo/Evan Vucci)
Evan Vucci/AP
President Donald Trump speaks during a news conference with Swedish Prime Minister Stefan Lofven in the East Room of the White House, Tuesday, March 6, 2018, in Washington. (AP Photo/Evan Vucci)
Now playing
01:57
Trump, California battle over immigration
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
Richard Drew/AP
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
Now playing
01:17
Trump to migrants: Make your nations great again
Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration's recent "zero tolerance" approach to immigration policy.  (Photo by John Moore/Getty Images)
John Moore/Getty Images
Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration's recent "zero tolerance" approach to immigration policy. (Photo by John Moore/Getty Images)
Now playing
01:06
Judge blocks asylum seekers from deportation
Pool
Now playing
01:51
Trump: I prefer shutdown before midterms
CHICAGO, IL - JUNE 29:  Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents.  (Photo by Scott Olson/Getty Images)
Scott Olson/Getty Images North America/Getty Images
CHICAGO, IL - JUNE 29: Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents. (Photo by Scott Olson/Getty Images)
Now playing
01:30
HHS refusing to release family separation stats
Now playing
01:01
Reporter to Sarah Sanders: Why did Trump lie?
Now playing
01:28
Trump: ICE agents are mean but have heart
Pool
Now playing
01:23
Trump: Our facilities better than Obama's
trump king of jordan visit
CNN
trump king of jordan visit
Now playing
01:15
Trump: No regrets signing executive order
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Brynn Anderson/AP
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Now playing
01:54
Children in limbo after Trump executive order
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Evan Vucci/AP
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Now playing
02:18
White House chaos over immigration reversal
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It's about keeping families together," Trump said at the signing ceremony. "I did not like the sight of families being separated," he added. (Photo by Mandel Ngan / AFP)        (Photo credit should read MANDEL NGAN/AFP/Getty Images)
MANDEL NGAN/AFP/Getty Images
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It's about keeping families together," Trump said at the signing ceremony. "I did not like the sight of families being separated," he added. (Photo by Mandel Ngan / AFP) (Photo credit should read MANDEL NGAN/AFP/Getty Images)
Now playing
02:49
What's next after Trump's policy reversal?
Trump meeting 06202018
POOL
Trump meeting 06202018
Now playing
02:33
Trump reverses position on family separations
President Donald Trump signs an executive order to keep families together at the border, but says that the 'zero-tolerance' prosecution policy will continue, during an event in the Oval Office of the White House in Washington, Wednesday, June 20, 2018. Standing behind Trump are Homeland Security Secretary Kirstjen Nielsen, left, and Vice President Mike Pence. (AP Photo/Pablo Martinez Monsivais)
Pablo Martinez Monsivais/AP
President Donald Trump signs an executive order to keep families together at the border, but says that the 'zero-tolerance' prosecution policy will continue, during an event in the Oval Office of the White House in Washington, Wednesday, June 20, 2018. Standing behind Trump are Homeland Security Secretary Kirstjen Nielsen, left, and Vice President Mike Pence. (AP Photo/Pablo Martinez Monsivais)
Now playing
01:52
Trump signs executive order to end family separations
CNN
Now playing
01:18
Trump: Take children away to prosecute parents
THE PRESIDENT meets with the National Space Council  In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
Pool
THE PRESIDENT meets with the National Space Council In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
Now playing
01:40
Trump: The US will not be a migrant camp
(CNN) —  

The Trump administration plans to require immigrants applying to come to the United States to submit five years of social media history, it announced Thursday, setting up a potential scouring of their Twitter and Facebook histories.

The move follows the administration’s emphasis on “extreme vetting” of would-be immigrants to the US, and is an extension of efforts by the previous administration to more closely scrutinize social media after the San Bernardino terrorist attack.

According to notices submitted by the State Department on Thursday, set for formal publication on Friday, the government plans to require nearly all visa applicants to the US to submit five years of social media handles for specific platforms identified by the government – and with an option to list handles for other platforms not explicitly required.

The administration expects the move to affect nearly 15 million would-be immigrants to the United States, according to the documents. That would include applicants for legal permanent residency. There are exemptions for diplomatic and official visas, the State Department said.

The decision will not take effect immediately – the publication of the planned change to visa applications on Friday will start a 60-day clock for the public to comment on the move.

The potential scouring of social media postings by potential immigrants is sure to rankle privacy and civil liberties advocates, who have been vocal in opposing such moves going back to efforts by the Obama administration to collect such information on a more selective and voluntary basis.

Critics complain the moves, amid broader efforts by the administration, are not only invasive on privacy grounds, but also effectively limit legal immigration to the US by slowing the process down, making it more burdensome and making it more difficult to be accepted for a visa.

Federal authorities argue the moves are necessary for national security.

In addition to requiring the five years of social media history, the application will also ask for previous telephone numbers, email addresses, prior immigration violations and any family history of involvement in terrorist activities, according to the notice.

Since its early days, the administration has been telegraphing a desire to more closely dig through the backgrounds and social media histories of foreign travelers, but Thursday’s move is the first time that it will formally require virtually all applicants to come to the US to disclose that information.

After the San Bernardino terrorist attack in 2015, greater attention was placed on immigrants’ social media use, when it was revealed that one of the attackers had advocated jihad in posts on a private social media account under a pseudonym that authorities did not find before allowing her to come to the US.

The move by the Trump administration stops short of requiring passwords or access to those social media accounts, although then-Homeland Security Secretary John Kelly suggested last year that it was being considered.

The administration has been pursuing “extreme vetting” of foreigners as a centerpiece of its immigration and national security policy, including through the contentious travel ban that remains the subject of heavy litigation.

CNN’s Laura Koran contributed to this report