Republicans managed to avoid catastrophe in West Virginia on Tuesday, when Don Blankenship lost that state's GOP Senate primary to a candidate with less baggage, Attorney General Patrick Morrisey.

But a Blankenship loss does not mean the GOP establishment has won the war against it's own party's fringe primary candidates.

The anti-establishment undercurrents that helped elect President Trump also helped Blankenship, an ex-con who aired racially charged ads against Senate Republicans' leader, as well as Roy Moore in Alabama, who lost a winnable Senate seat last year facing sexual misconduct allegations. In other words, they're still very much in play this election cycle. And so are some candidates who could benefit from that.

That means that as they try to hang onto their slim majority, Republican Senate leaders may be forced to play whack-a-mole again in more primaries, like Arizona, to make sure that extreme candidates who could lose a general election don't win over more viable figures.

Even moderate candidates are attempting to flex their Trumpian-muscles by campaigning on a version of dog-whistle politics that got Blankenship so much attention. (See this racially tinged ad on immigration recently released by a Republican candidate in Montana's crowded Senate primary.)

Going to battle with its own party is a potentially scary proposition for Republicans right now. Their efforts to tamp down on these kinds of candidates hasn't always been successful. In 2010 and 2012, a number of them got nominated only to lose potentially winnable seats.

Recently, the establishment getting involved may have only helped the person they're trying to shut down. Moore won his party's nomination despite the entire Republican leadership backing his opponent, then refused to drop out after sexual misconduct allegations despite everyone in Washington save Trump urging him to go, then lost a Senate race for the party in Alabama.

After that, Senate Majority Leader Mitch McConnell (R-Ky.) felt so strongly that Blankenship needed to lose (Blankenship did nothing to ease that sentiment when he attacked McConnell's wife's ethnicity), that McConnell allies set up an entire super PAC to spend more than $1 million to sink him in the final days.

It worked, but Blankenship's candidacy came too close for comfort, fraying nerves that are still unsettled by the party's loss in Alabama.

Not helping matters is that other big primaries Tuesday underscored just how en vogue outsiders are in politics. Businessman and former state representative Mike Braun won the GOP's Senate nomination in Indiana by beating two conservative members of Congress.

Businessman Mike Braun called for GOP unity after defeating Reps. Luke Messer and Todd Rokita in Indiana’s Republican Senate primary on May 8. (JM Rieger/The Washington Post)

In North Carolina, a member of Congress — GOP Rep. Robert Pittenger — lost his primary reelection bid to a former pastor, Mark Harris.

Neither of these outsider candidates carry anywhere near the controversy that Blankenship did in West Virginia, but their wins underscored for Republicans that the resume line of being an outsider is a politically powerful one right now.

And candidates like Blankenship have found attention-grabbing ways to seize it.  Blankenship tried to distinguish himself in a busy primary by attacking McConnell in extremely personal ways. Moore went so far as to question whether McConnell was being harder on him versus Democrats accused of sexual misconduct.

Unlike in Alabama, Senate GOP leadership and Trump were on the same page in believing that West Virginia's fringe candidate needed to lose. That may not be the case in a primary for an open Senate set in Arizona, where former sheriff Joe Arpaio (who was recently pardoned by Trump for a misdemeanor of contempt of court) and Kelli Ward (a Senate candidate known for saying controversial things) are running against establishment pick Rep. Martha McSally in the primary.

Both Arpaio and Ward have received nods from Trump and his allies in the past. Sometimes the really recent past: Vice President Pence (R) praised Arpaio as “a tireless champion of strong borders and the rule of law” while in Arizona last week.

Democrats have their own primary battles warning them that getting heavily involved can backfire. This spring, House Democrats' campaign arm attacked a Democratic candidate in a competitive Texas race. She made it in the top two and will compete in a run off later this month. In Colorado, a Democrat secretly recorded his conversation with a House Democratic leader praising primary meddling and leaked it to the media.

But Republicans are the ones with arguably more at stake here. They are trying to defend their imperiled majority in the House of Representatives and a slim majority in the Senate. To do that, they need to nominate strong candidates capable of unseating Senate Democrats in Trump states.

At a time when a candidate like Moore can win a primary against all odds and Trump can become president despite the GOP establishment's best efforts to stop him, even a Blankenship's loss doesn't prove they've found a formula to nip in the bud controversial, flameout candidates before it's too late.

Don Blankenship, who is running for the GOP Senate nomination in West Virginia, released an ad attacking Senate Majority Leader Mitch McConnell (R-Ky.). (Don Blankenship)