The ancient hatred has migrated to the internet.

The San Diego synagogue shooter was self-radicalized on a right-wing message board on the website 8chan, posting before he went on his rampage a thank-you to the board’s users: “What I’ve learned here is priceless.”

The attack, which killed one and injured three, came six months to the day after the shooting at the Tree of Life synagogue in Pittsburgh that killed 11. The San Diego shooter declared the Pittsburgh shooter — also a creature of fringe internet culture — one of his heroes.

Anti-Semitism is a millennia-old phenomenon, and anti-Jewish shootings in the US aren’t new, either (several occurred while George W. Bush and Barack Obama were president).

What’s disturbing about the latest spate of violence is the common thread of white nationalist ideology, propagated and readily available on the internet and developing its own twisted culture of mass shootings.

What happened two decades ago with the 1999 Columbine mass shooting, which created the predicate for years of copycat killers, each soaked in the iconography of Columbine and seeking their own moment of notoriety, is being replicated by a loose collection of sick racists.

The San Diego shooter attested to how quickly he had been prepped for mass murder by 8chan, where white nationalists push one another to undertake acts of violence that they call “real-life effort-posting.” He said he never could have imagined killing even a few months ago and that he planned the attack in four weeks.

He explained that he was ­inspired by the Christchurch mosque shooter, who killed 50 innocents in New Zealand and came from the same white nationalist 8chan sewer.

The San Diego shooter aped his hero by also posting a similarly long manifesto to the site and attempting to livestream his crime.

Today’s internet anti-Semitism is based on very old lies, at the bottom of which is the belief that Jews are an alien, parasitic force conspiring against their host, in this case supposedly the white race.

The San Diego shooter even cited a notorious lie dating from the 15th century that Jews had used the blood of a Christian boy to bake their Passover matzohs.

What the 8chan haters add to the ancient anti-Semitic oeuvre is their very internet in-jokes and memes, underscoring their rancid nihilism.

Because everything must be about President Trump, the left blames him for Pittsburgh and San Diego. His critics point to his shabby response to Charlottesville (Trump actually did condemn the white nationalists and neo-Nazis, but posited “fine people” on their side who didn’t exist). Yet Trump was explicitly ­rejected by the San Diego and Pittsburgh shooters, precisely ­because he’s so pro-Israel.

His State of the Union Address this year was notably philo-Semitic. “We must never ignore the vile poison of anti-Semitism, or those who spread its venomous creed,” he said while recognizing a hero of the Pittsburgh massacre. “With one voice, we must confront this hatred anywhere and everywhere it occurs.”

At the same time an extreme fringe on the right marinates in its own malice, a different sort of anti-Semitism, rooted in hatred for Israel, is getting normalized on the left.

It can be seen in the refusal of House Democrats to forthrightly condemn Rep. Ilan Omar for her anti-Semitic tropes and in the astonishing publication by the international edition of the New York Times of a political cartoon worthy of Der Sturmer.

It’s not the 1930s again, but the elite atmosphere is becoming more hostile to Israel than it has been for many decades, and the physical threat to Jews is growing. According to news reports, the San Diego shooting might have been much worse if the Poway Chabad congregation hadn’t ­recently practiced shooter drills, and other synagogues will have to take note.

If the freaks on 8chan have anything to say about it, there will be a next time.

Rich Lowry is editor of National Review.

Twitter: @RichLowry