Hillary Clinton’s allies poll-tested whether voters would be put off by Barack Obama’s ties to Islam in the 2008 Democratic primary election, according to hacked emails released by WikiLeaks.

Specifically, Clinton’s friends sought reaction from voters to this statement about the then-senator from Illinois: “Obama’s father was a Muslim and Obama grew up among Muslims in the world’s most populous Islamic country.”

The revelation comes from the personal emails of John Podesta, a close Clinton confidant and now the chair of Hillary Clinton’s presidential election campaign.

Podesta is cc’d on a January 2008 email chain — titled “McCain Survey” — though he doesn’t appear to make any comment one way or the other. John McCain was the eventual Republican nominee that year.

The surveying appears to have been performed by Greenberg Quinlan Rosner Research, a Democratic polling firm in Washington.

Paul Begala, who was on the email exchange along with the pollster, said Thursday the testing was not for use by the Clinton campaign — but for Obama’s defenders.

“That was a draft poll questionnaire that tested potential right-wing attacks on Obama, to help prepare to defend him,” Begala, who helped get Bill Clinton elected in 1992 and is working toward getting Hillary Clinton elected now, said in an email to The Post.

“I was part of a Super PAC called Progressive Media, which brought together Clinton and Obama supporters to prepare for the general election and support whoever won the nomination. I had no role in the 2008 Clinton campaign,” he added.

The group also message-tested Obama’s use of cocaine and support of gay adoption.

“Obama described his former use of cocaine as using ‘a little blow,’” read one statement.

“Obama is ranked as one of the ten most liberal members of the Senate because of his support of issues like gay adoption,” read another statement.

Additionally, the Clinton allies sought voter feedback on Obama not wearing a flag pin, his ties to a corrupt land dealer, his proposal to talk with “terrorist nations like Iran and North Korea without preconditions,” and his positions on guns, abortion and illegal immigrants.

Clinton lost the 2008 Democratic primary contest to Obama — though she later served in his administration as secretary of state.

Begala said the group broke apart after Obama won the Democratic nomination.

“We came together to plan for the general election out of concern that the long, difficult primary would damage the eventual nominee. After Sen. Obama won the nomination, his campaign issued a public statement calling on us and other independent groups to disband, so we did,” he said.

“Hillary Clinton may mimic the Obamas ‘when they go low, we go high’ line, but it turns out it was her campaign that first questioned President Obama’s childhood, faith and family in the ugliest of ways, and years before others,” said Raj Shah, Republican National Committee deputy communications director.

“This is just the latest in her pattern of hypocritical attacks and dishonesty,” Shah added.