Facebook co-founder, Chairman and CEO Mark Zuckerberg testifies before the House Energy and Commerce Committee in the Rayburn House Office Building on Capitol Hill April 11, 2018 in Washington, DC.

Facebook and Twitter are clamping down on political ads ahead of the 2018 midterm elections in an effort to close loopholes that were exploited during the 2016 presidential campaign.

As of Thursday, all election and issue-based ads on Facebook and Instagram must be labeled and have a "paid for by" disclaimer. Users can click through to an archive, which will show the campaign budget for that specific ad, how many people saw it, and more details about viewers including age, gender and location. The archive will store this information for seven years.

Political advertisers in the United States will have to affirm their identity and location, following an announcement in April that requires verification for people buying political ads.

And Facebook is now grouping both issue-based and electoral ads under the umbrella of political ads. This move was prompted by the Russia-based Internet Research Agency's penchant for stirring up emotion, without necessarily mentioning a specific candidate or election. For now, Facebook has identified 20 topics, from abortion to poverty, which fall under the "issues" category.

"The aim is for this effort to reflect the latest public discourse," Katie Harbath, Facebook's global politics and government outreach director, said on a call with media.

Facebook will partner with such organizations as the Comparative Agendas Project and market research agency YouGov to create a "living, breathing document" of issues that will evolve over time.

Likewise, Twitter announced Thursday that it's placing more regulations on election ads. All advertisers for federal elections will have to certify that they are living in the U.S., and candidates and committees will have to provide their Federal Election Campaign identification.

Both companies have faced criticism from investors, politicians and users in the aftermath of the 2016 election, for allowing groups to mask as political entities and flood their networks with targeted political propaganda. Facebook said late last year that 126 million Americans may have seen content or ads created by Russian-backed trolls ahead of the election.