Some investors are reducing their exposure to longer-dated corporate bonds as rising yields expose them to a greater risk of losses.

That could help reverse one of the biggest credit trends of recent years, where companies have been selling bonds with longer maturities and yield-starved investors have been snapping them up.

Duration is a measure of how sensitive a bond's price is to changes in interest rates. It is higher for longer-term bonds because the greater time it takes for investors to get their money back means greater exposure to swings in value. It also is higher for lower-coupon bonds, which provide less cash-flow to buffer those swings.

A rule of thumb is that a 1 percentage-point change in interest rates implies a change in the bond's price equal to the duration. A bond with a duration of 10 years will jump 10% if interest rates fall by 1 percentage point and fall 10% if rates rise by the same amount.

And yields have climbed to multiyear highs in recent weeks. The yield on the benchmark 10-year U.S. Treasury note on Thursday spiked as high as 2.883% in volatile trading, according to FactSet, before settling at 2.851%--near its highest level since January 2014. Several investors and analysts said the gains came after tax cuts and plans for a budget raised concerns that the Treasury would need to borrow more to fund deficits.

Bond auctions this week met with tepid demand, investors said, pushing yields higher still. This month's offerings are the first at the larger sizes the Treasury unveiled last week, and investors are concerned that risks from widening budget deficits will force the government to offer higher yields at future sales to encourage demand. Bond analysts have said they expect the government will need to increase offering sizes again as soon as May and again later in the year.

While the spread between government and corporate bonds has narrowed, the recent rise in sovereign yields is weighing down company bonds.

In recent days, yields have been rising at a faster pace for corporate bonds with longer maturities.

"Duration is definitely a major risk and we've been worried about it for quite some time," said Rachid Semaoune, a credit fund manager at Royal London Asset Management, who currently prefers shorter-dated bonds over longer maturities.

The additional risk taken on by holders of corporate bonds in recent years reflects the efforts of central banks to spur faster growth and inflation by lowering borrowing costs, while encouraging investors to take on more risk. Ultralow rates have helped push investors to seek higher returns in corporate bonds, sending the premium company bonds fetch over government debt to decade lows.

Recently, however, central banks have signaled plans to step back from postcrisis stimulus efforts and investors in the U.S. have become more concerned that higher wages could lead to faster U.S. inflation. That has prompted speculation that the Federal Reserve could speed up the pace of raising interest rates. That has helped to drive down prices on government bonds and push yields higher.

When yields rise, bond investors typically trade into shorter-term securities and out of longer-term debt to minimize the potential for losses. Prices for long-term bonds typically fall more than those for short-term debt, because of the greater potential for the purchasing power of their fixed interest to erode as yields rise.

Christophe Auvity, head of credit at BNP Paribas Asset Management, said that he has been positioning the fund's portfolios to favor bonds that are less sensitive to rates and more sensitive to its credit fundamentals, such as cash flows.

Average maturity in the U.S. corporate market has risen to 10.5 years from 9.6 years in 2013, for bonds listed on the ICE Bank of America Merrill Lynch Corporate index. For euro-denominated credit, it is up to 5.76 from 5.06 years in the same period, and it has risen to 12.5 from 11.6 in the sterling market.

Even in recent weeks, some big European and U.S. companies, including brewer AB InBev and Comcast Corp., have been selling bonds that don't come due for more than 15 years. Last week, Wellcome Trust, a British charitable foundation, sold GBP750 million ($1.05 billion) worth of bonds that mature in 100 years.

Other companies that have sold long-dated bonds include Amazon.com Inc., which sold $3.5 billion of 30-year bonds in August; Oracle Corp., which sold $2.25 billion of 30-year bonds in November; and Northrop Grumman Corp., which sold $2.25 billion of 30-year bonds in October.

Such longer maturities, coupled with record-low coupons, have left the market more exposed to rises in government bond yields. Duration in U.S. dollar, euro and sterling investment-grade corporate bonds stands near record highs, according to ICE Bank of America Merrill Lynch indexes. A 1% rise in yields would have triggered a 5.4% drop in U.S. corporate bond prices in that index in late 2008. The same yield increase today would trigger a price drop of more than 7%.

Longer-dated bonds are suffering more.

The price of Microsoft Corp.'s 2057 dollar bonds have fallen by 4.1% so far this month. The price of a Microsoft bond that matures in 2023 is down 0.5%, according to data from MarketAxess. The price of Ford Motor Co.'s 2027 dollar bond fell 2.4% in February, while its 2022 note slipped just 0.8%.

There are other ways to reduce duration risk than just selling longer-dated bonds. You can also buy bonds with higher coupons, which means you will make your money back sooner, or use derivatives to offset duration among the portfolio's corporate bonds.

Olivier Debat, a fund manager at Union Bancaire Privee in Switzerland, has been reducing his duration since December as he anticipated higher yields. In December, an average 1% rise in the yields of debt in his portfolio would have reduced the value of his portfolio by 0.7%. By the end of January, he had taken measures to limit the potential decline to 0.2%, he said.

--Matt Wirz contributed to this article.

Write to Tasos Vossos at Tasos.Vossos@wsj.com and Daniel Kruger at Daniel.Kruger@wsj.com