Congressional candidate Alexandria Ocasio-Cortez banned the press from two community meetings in The Bronx and Queens that were open to all other members of the public — and now she’s taking heat for it.

The 28-year-old Democratic socialist has been a darling of the left since toppling Rep. Joe Crowley, the Queens Democratic leader, in June’s primary and appears to be a shoo-in for election in November.

As part of a “listening tour,” she invited future constituents to a meeting in The Bronx on Aug. 8 and in Corona, Queens on Sunday.

But reporters — including from the local Queens Chronicle that specializes in covering such events — were barred.

“Unless you were in the room on Sunday, you won’t know what specific community problems were mentioned or how Ocasio-Cortez planned to address them once she was sworn in,” Christopher Barca, one of the weekly’s editors, wrote afterward.

Ocasio-Cortez’s campaign manager, Vigie Ramos Riso, complained to the Chronicle that the candidate was “‘mobbed” by reporters” at a previous meeting even “though we said no Q&A and no one-on-one interviews” and that’s why the ban was instituted.

The bone-headed move evokes the White House blocking CNN reporter Kaitlan Collins from covering an event last month.

Colllins on Friday took note of Ocasio-Cortez’s action, tweeting a link to the Chronicle story under the heading, “Ocasio-Cortez bans press from town hall.”

Other commentators also hammered the progressive star on social media.

Ocasio-Cortez spokesman Corbin Trent told The Post the press restriction was “an outlier, not the norm” and vowed it wouldn’t happen again.

“This is not policy,” Trent said, stressing that the candidate has otherwise been accessible to the press.

“This is making a mountain of a mole hole. The idea was to create a comfortable space. Most people are not used to a whole lot of cameras and reporters,” he said.