VIRGINIA ATTORNEY General Ken Cuccinelli II, the Republican candidate for governor, has been trying to scrub his illegal immigrant-bashing past, which appears badly out of sync with the views of most Virginians, according to polls. As The Post’s David Nakamura reported, all mention of immigration was dropped from the candidate’s Web site in the spring.

That’s a sharp departure from Mr. Cuccinelli’s passionate stance on the issue as a state lawmaker and as attorney general. At various times, he has led the charges to deny citizenship to the ­American-born children of illegal immigrants; to authorize lawsuits against employers who would hire illegal immigrants; to prevent undocumented students, even if they grew up in Virginia, from qualifying for in-state tuition at public colleges and universities; and even to block legal immigrant workers from collecting unemployment benefits if they are fired for not speaking English on the job.

“It is beyond debate that these people do not have the right to be in this country,” he wrote, referring to illegal immigrants, while running for attorney general four years ago. Today, more than two-thirds of Virginians support eventual citizenship for most illegal immigrants, according to a survey conducted in the spring by Harper Polling, a Republican firm.

In the past, Mr. Cuccinelli has trumpeted most of those stances on the Web sites he maintained as a state senator, as a candidate for attorney general and as attorney general. Now, his allies insist that immigration is hardly a state issue at all — despite the copious legislation that Mr. Cuccinelli and other conservatives sponsored and voted for — and that critics are unfairly maligning him on the issue.

Immigration is one of a number of subjects where Mr. Cuccinelli has made ample use of editing to play down his record as a crusading social conservative — an effort he continued Wednesday in a debate with Terry McAuliffe, the Democratic gubernatorial candidate.

As attorney general, he tormented homosexuals, whom he once scorned as inviting “nothing but self-destruction, not only physically but of their soul.” He tried energetically to preserve a law banning oral and anal sex, a measure long regarded as targeting homosexuals. Yet as a candidate for governor, he has cast his defense of Virginia’s anti-sodomy law as an effort to shield children from predators. That’s a stretch. And in Wednesday’s debate, he said the suggestion that he had called gays “soulless” was “offensively false.”

He has muted his longtime position doubting the science on climate change. On guns, although he has been a a steadfast advocate for expanding permission to carry concealed weapons (for example, on the campus of the University of Virginia), he now says he understands that “many people have reasonable concerns about the misuse of firearms.” He sponsored a state constitutional amendment granting protection to the “preborn” from “the moment of fertilization,” which would have opened the way to challenges to common methods of birth control, including the pill and intrauterine devices. Now Mr. Cuccinelli insists he intended no such outcome.

It’s not a bad thing that the general election has prompted Mr. Cuccinelli to move toward the center; if he is elected, many Virginians would hope he governs from there. Still, it’s worth bearing in mind the considerable distance that Mr. Cuccinelli must move to reach the center — and the passion with which he has defended his views in the past.