As polls tighten and self-described socialist Bernie Sanders looks more like a serious contender than a novelty candidate for president, the liberal media elite have suddenly stopped calling him socialist. He’s now cleaned up as a “progressive” or “pragmatist.”

But he’s not even a socialist. He’s a communist.

Mainstreaming Sanders requires whitewashing his radical pro-communist past. It won’t be easy to do.

If Sanders were vying for a Cabinet post, he’d never pass an FBI background check. There’d be too many subversive red flags popping up in his file. He was a communist collaborator during the height of the Cold War.

Rewind to 1964.

While attending the University of Chicago, Sanders joined the Young People’s Socialist League, the youth wing of the Socialist Party USA. He also organized for a communist front, the United Packinghouse Workers Union, which at the time was under investigation by the House Committee on Un-American Activities.

After graduating with a political science degree, Sanders moved to Vermont, where he headed the American People’s History Society, an organ for Marxist propaganda. There, he produced a glowing documentary on the life of socialist revolutionary Eugene Debs, who was jailed for espionage during the Red Scare and hailed by the Bolsheviks as “America’s greatest Marxist.”

This subversive hero of Sanders, denounced even by liberal Democrats as a “traitor,” bashed “the barons of Wall Street” and hailed the “triumphant” Bolshevik revolution in Russia.

“Those Russian comrades of ours have made greater sacrifices, have suffered more, and have shed more heroic blood than any like number of men and women anywhere on Earth,” Debs proclaimed. “They have laid the foundation of the first real democracy that ever drew the breath of life in this world.”

In a 1918 speech in Canton, Ohio, Debs reaffirmed his solidarity with Lenin and Trotsky, despite clear evidence of their violent plunder and treachery.

Sanders still hangs a portrait of Debs on the wall in his Senate office.

In the early ’70s, Sanders helped found the Liberty Union Party, which called for the nationalization of all US banks and the public takeover of all private utility companies.

Mainstreaming Sanders requires whitewashing his radical pro-communist past. It won’t be easy to do.

After failed runs for Congress, Sanders in 1981 managed to get elected mayor of Burlington, Vt., where he restricted property rights for landlords, set price controls and raised property taxes to pay for communal land trusts. Local small businesses distributed fliers complaining their new mayor “does not believe in free enterprise.”

His radical activities didn’t stop at the ­water’s edge.

Sanders took several “goodwill” trips not only to the USSR, but also to Cuba and Nicaragua, where the Soviets were trying to expand their influence in our hemisphere.

In 1985, he traveled to Managua to celebrate the rise to power of the Marxist-Leninist Sandinista government. He called it a “heroic revolution.” Undermining anti-communist US policy, Sanders denounced the Reagan administration’s backing of the Contra rebels in a letter to the Sandinistas.

His betrayal did not end there. Sanders lobbied the White House to stop the proxy war and even tried to broker a peace deal. He adopted Managua as a sister city and invited Sandinista leader Daniel Ortega to visit the US. He exalted Ortega as “an impressive guy,” while attacking President Reagan.

“The Sandinista government has more support among the Nicaraguan people — substantially more support — than Ronald Reagan has among the American people,” Sanders told Vermont government-access TV in 1985.

Sanders also adopted a Soviet sister city outside Moscow and honeymooned with his second wife in the USSR. He put up a Soviet flag in his office, shocking even the Birkenstock-wearing local liberals. At the time, the Evil Empire was on the march around the world, and threatening the US with nuclear annihilation.

Then, in 1989, as the West was on the verge of winning the Cold War, Sanders addressed the national conference of the US Peace Council — a known front for the Communist Party USA, whose members swore an oath not only to the Soviet Union but to “the triumph of Soviet power in the US.”

Today, Sanders wants to bring what he admired in the USSR, Cuba, Nicaragua and other communist states to America.

For starters, he proposes completely nationalizing our health care system and putting private health insurance and drug companies “out of business.” He also wants to break up “big banks” and control the energy industry, while providing “free” college tuition, a “living wage” and guaranteed homeownership and jobs through massive public works projects. Price tag: $18 trillion.

Who will pay for it all? You will. Sanders plans to not only soak the rich with a 90 percent-plus tax rate, while charging Wall Street a “speculation tax,” but hit every American with a “global-warming tax.”

Of course, even that wouldn’t cover the cost of his communist schemes; a President Sanders would eventually soak the middle class he claims to champion. From each according to his ability, to each according to his need, right?

Former mayoral advisers from Burlington defend their old boss. They note that Sanders was never a member of the Communist Party and deny he was even a small-c communist, even while acknowledging he named their city softball squad the “People’s Republic of Burlington” and the town’s minor league baseball team the “Vermont Reds.”

What about those communist sister cities he adopted? “Bernie established them to support people-to-people exchanges which might support peace in the long run,” said Bruce ­Seifer, who was one of Sanders’ central economic planners directing Burlington businesses to “reinvest their profits in the community.”

In an interview, Seifer claimed that it was “no different than President Nixon opening relations with China.”

Please. Sanders and his Sanderistas are all still pining for what Debs called “the Greater Revolution yet to come.”

What’s revolting is how this hardcore commie’s campaign has gotten this far. With his ascendancy in both Iowa and New Hampshire, Sanders is no longer just a fool; he’s now a dangerous fool.

While it may be hard to hate the old codger, it’s easy — and virtuous — to hate his un-American ideas. They should be swept into the dustbin with the rest of communist history.

Paul Sperry is a visiting Hoover Institution media fellow and author of “The Great American Bank Robbery,” which exposes progressive policies behind the mortgage bust. Email: Sperry@SperryFiles.com.