In the span of a few days this week, Scott Walker emphasized that he opposes abortions, with no exceptions in cases of rape or incest or to save the woman’s life. Marco Rubio shot down a suggestion that he advocated exceptions for rape or incest.

On immigration, Rubio said he backed a fence to keep illegal immigrants out of the country, echoing front-runner Donald Trump’s call for a new border wall. And on same-sex marriage, Rick Santorum compared the legalization of such unions to the infamous Supreme Court ruling that African Americans could not be U.S. citizens.

Some of the statements reflected shifts in priorities or positions over the long term; Rubio, for example, has abandoned Senate legislation he helped craft that would give illegal immigrants a path to citizenship. Others reflected candidates’ decisions to emphasize conservative positions more than they had before.

Either way, in the most wide-open Republican presidential field in memory, most of the contenders continued a rush to the right this week in the hope of capturing the attention of the GOP base. The strategy is clearly aimed at primary contests in states such as Iowa and South Carolina, which are dominated by large blocs of evangelicals and other conservative voters.

But it could also cause the eventual nominee problems in a general election with a more moderate electorate. On social issues ranging from abortion to same-sex marriage, much of the Republican field has now taken positions that are at odds with mainstream American opinion. For example, 3 out of 4 Americans say a woman should be able to obtain a legal abortion if she becomes pregnant as a result of rape.

We've heard the top ten GOP candidates talk. Here's what happens now.

Moderate Republicans said Friday they are concerned about the potential for Democrats to revive their “war on women” line of attack from 2012, when they successfully portrayed presidential nominee Mitt Romney and other Republicans as out of touch with or even hostile to the concerns of women.

Hillary Rodham Clinton and other Democrats have moved swiftly to capi­tal­ize on some of the remarks this week, particularly those made at Thursday night’s widely watched Republican debate in Cleveland.

“I think there is a lot of work to do, and obviously it is a harder challenge when you have a [Democratic] woman candidate and potentially the idea of the first-ever woman president,” said Katie Packer Gage, a former deputy campaign manager for Romney.

Democratic National Committee Chairman Debbie Wasserman Schultz on Friday compared the crop of Republican hopefuls to Todd Akin, whose 2012 Senate bid was derailed when he said “legitimate rape” rarely causes pregnancy.

“Every Republican running for president still agrees with him about denying a woman’s right to make her own health-care decisions,” Wasserman Schultz said.

Clinton, the Democratic front-runner, attacked Republicans in a fundraising e-mail: “Ten men stood on stage and ignored 51% of the American population.”

Women made up 53 percent of the electorate in the previous two presidential elections, according to exit-poll data. President Obama won 55 percent of their vote in 2012 and 56 percent in 2008. Democrats hope Clinton could boost those numbers in 2016 if she becomes the nominee.

The Republican conundrum was on full display in Thursday’s debate. The contenders were determined not to be outflanked by their competitors in the eyes of socially conservative voters, who play a major role in the early primary states.

Walker, Wisconsin’s governor, was asked by Fox News Channel’s Megyn Kelly whether his staunch opposition to abortion without exceptions puts him out of the mainstream.

“I believe that that is an unborn child that’s in need of protection out there, and I’ve said many a time that that unborn child can be protected, and there are many other alternatives that can also protect the life of that mother,” Walker said. “That’s been consistently proven.”

Later, Rubio, a 44-year-old senator from Florida pitching himself as the GOP’s best chance to defeat Clinton, said he has never backed allowing abortion in cases of rape or incest. “What I have advocated is that we pass a law in this country that says all human life at every stage of its development is worthy of protection,” he said.

Rubio appeared eager to be portrayed as sufficiently conservative on abortion, even though it is not an issue he emphasizes much on the campaign trail. He has supported measures that included exceptions for victims of rape or incest, but he has also backed bills without them, leaving him room to argue that he did not advocate for the exceptions. Democrats say that if he is the nominee, his debate comments will come back to haunt him.

“Republicans have to be careful not to fall into the trap laid by Democrats so successfully in the 2010 election into the 2012 election cycle,” said Steve Schmidt, a former top presidential campaign adviser to Sen. John McCain (R-Ariz.).

Seventy-five percent of Americans in the 2014 General Social Survey said a woman should be able to obtain a legal abortion if she becomes pregnant as a result of rape, and 21 percent disagreed. Among Republicans, 31 percent oppose abortion in cases of rape (65 percent support it); the number rises to 46 percent among Republicans who are evangelical Protestants.

Other issues could cause problems for Republicans in the general-election race. Immigration has propelled Trump, the real estate mogul who has soared to the top of the polls with his combative rhetoric about “rapists” and other criminals from Mexico, even as polling shows most Americans think that undocumented Mexican immigrants are mainly honest people trying to get ahead. Trump has called for the construction of a massive wall on the border to keep “illegals” out.

“I also believe we need a fence,” Rubio said in Thursday’s debate. “The problem is if El Chapo builds a tunnel under the fence, we have to be able to deal with that, too,” he said, referring to the escaped Mexican drug kingpin.

On same-sex marriage, most of the top-tier Republican contenders have moved on to a fight to protect religious liberty since the Supreme Court legalized such marriages nationwide this year and as polling shows that most of the public approves of the decision. But longer-shot candidates are not retreating.

Asked at a debate for second-tier candidates Thursday whether same-sex marriage is “settled law,” Santorum, a former senator from Pennsylvania, replied: “It is not, any more than Dred Scott was settled law to Abraham Lincoln.”

Some of the GOP’s challenge comes down to tone and word choice.

“You’ve called women you don’t like ‘fat pigs,’ ‘dogs,’ ‘slobs’ and ‘disgusting animals,’ ” Kelly told Trump in the debate.

“Only Rosie O’Donnell,” he shot back, prompting laughs and applause from the audience.

Earlier this week, Jeb Bush, a former Florida governor and the GOP establishment favorite, said at a Christian conservative forum that he was “not sure we need half a billion dollars for women’s health issues.” After Clinton and other Democrats attacked him, he said he “misspoke.”

After their problems in 2012, Republicans were mostly able to blunt Democratic attacks on women’s issues in the 2014 midterms. And they say that in this election, they are making new inroads.

Gage called Trump a “misogynist, sexist carnival barker.” But most of the other candidates, she said, are “articulating a very positive, forward-thinking vision.”

Bush has pointed to his record as governor of helping women who were victims of domestic violence. Both he and Rubio talk far more about the economy than about social issues such as abortion and same-sex marriage. And both have committed to some type of immigration reform that would eventually give legal status to undocumented immigrants.

At Thursday’s debate, Ohio Gov. John Kasich refused to back down from his support of Medicaid expansion in his state, which many conservatives oppose.

That the GOP field is dominated by men does not make the party’s hurdles with female voters any easier. The one woman in the field is former Hewlett-Packard chief executive Carly Fiorina. She has been an afterthought and lags in the polls, but a breakout performance in Thursday’s undercard debate won her widespread praise.

If Fiorina polls well enough to qualify for the next top-tier debate, her presence could cause the Republican front-runners more headaches. Moments after her debate ended, she criticized Bush to reporters.

“It’s really disappointing when a front-runner gives the Democrats an ad and a talking point before he’s even in the ring,” she said.

Philip Rucker, Scott Clement, Anne Gearan, Ed O’Keefe and Jenna Johnson contributed to this report.