U.S. stocks rose and government-bond yields fell Wednesday following a recent climb, potentially easing some pressure on technology shares. 

The S&P 500 was up 1.2% in recent trading. The broad index rose Tuesday as investors snapped up shares of companies across industries. The Dow Jones Industrial Average climbed 240 points, or 0.7%, while the Nasdaq Composite added 1.6%. While all three indexes are up this week so far, they are in negative territory year to date.

Wednesday’s...

U.S. stocks rose and government-bond yields fell Wednesday following a recent climb, potentially easing some pressure on technology shares

The S&P 500 was up 1.2% in recent trading. The broad index rose Tuesday as investors snapped up shares of companies across industries. The Dow Jones Industrial Average climbed 240 points, or 0.7%, while the Nasdaq Composite added 1.6%. While all three indexes are up this week so far, they are in negative territory year to date.

Wednesday’s advance came as 10 out of the 11 sectors within the S&P 500 rose. Five were up at least 1%.

Markets have been hurt in recent days by a rout in tech stocks. Investors have been unloading shares of tech companies with lofty valuations ahead of a potential increase in interest rates by the Federal Reserve.

Analysts said the volatility could continue until investors get clear guidance from the Fed about the rate increases ahead. Some are betting the turbulence will continue throughout 2022.

“We could potentially see bouts of volatility throughout this year, especially as the Fed starts its tightening cycle; that’s usually when markets have a little bit of indigestion,” said Mona Mahajan, a senior investment strategist at Edward Jones.

Fresh inflation data due Thursday is expected to give investors additional clues as to how quickly the Fed may raise rates after slashing them in 2020 to cushion the economy from the impact of Covid-19. Matt Weller, global head of market research at Forex.com, said a notable jump in core inflation data could persuade the Fed to act more aggressively and raise rates by 50 basis points.

Analysts said a more aggressive Fed could hurt tech companies even more. Shares of Facebook parent Meta Platforms rose 5.8% after falling 20% last week. Google parent Alphabet added 0.9%. Technology companies tend to benefit from low bond yields as some investors will pay more for shares that they expect to churn out outsize profits in the future.

“Don’t necessarily assume this is the worst it can get, and if you’re feeling uneasy, I would consider lightening up on risky exposure,” said Mr. Weller.

The yield on the benchmark 10-year U.S. Treasury note ticked down to 1.934% Wednesday from 1.954% Tuesday, its highest closing level since July 2019. Yields move inversely to prices. 

The Federal Reserve has signaled it plans to raise interest rates in 2022 in response to stubbornly high inflation. WSJ’s J.J. McCorvey explains what higher rates could mean for your finances. Photo illustration: Todd Johnson

European bonds yields also fell Wednesday, with the yield on the 10-year German bund ticking down to 0.218% from 0.264% Tuesday, according to Tradeweb.

“All market participants are now trying to gather more information on how this global turnaround of central banks will happen,” said Carsten Brzeski, ING Groep’s global head of macro research. “There is a question of how stock markets will adjust to this new normal.”

Uber Technologies and Walt Disney are slated to post results late Wednesday. Shares of Chipotle Mexican Grill rose 10% after it said it had increased menu prices again and was likely to raise them further this year. Lyft rose 5.6% after the ride-hailing company posted weaker-than-expected ridership numbers.

CVS Health fell 5.7% after the drugstore chain reported quarterly results that beat expectations, but provided a mixed full-year outlook.

Investors are monitoring factors that could affect earnings, including the anticipated increase in interest rates, elevated inflation and supply-chain disruptions. As of late last week, 34 companies in the S&P 500 had given lower earnings guidance than analysts expected, while 13 companies had issued higher guidance, according to FactSet.

The prospect of higher borrowing costs globally has heightened volatility in stocks this year.

Photo: David L. Nemec/Associated Press

Brent crude, the global oil benchmark, fell 0.1% to $91.48 a barrel.

Overseas, the pan-continental Stoxx Europe 600 rose 1.7%. Shares of Dutch payment company Adyen jumped around 9% after it reported a profit rise that beat market expectations. 

The Russian ruble rose 0.4% against the dollar. French President Emmanuel Macron shuttled from Moscow to Kyiv on Tuesday in an attempt to avert conflict between Ukraine and Russia. Some investors hope that continuing communication will reduce the chances of tensions escalating, Mr. Brzeski said. 

In Asia, major stock indexes closed with gains. Hong Kong’s Hang Seng jumped 2.1% and Japan’s Nikkei 225 added 1.1%. China’s Shanghai Composite and South Korea’s Kospi gained 0.8% each.

Write to Caitlin Ostroff at caitlin.ostroff@wsj.com and Hardika Singh at hardika.singh@wsj.com