The bond market has gotten unparalleled interest from investors in recent years, even as yields plunged due to the Federal Reserve's rate-reducing policies. As usual, it took big losses to convince mainstream investors to exit bonds, but they've finally begun to do so -- and their timing, while not perfect, should be good in the long run.

A stampede away from bonds
Investors sold $80 billion in bond mutual fund and ETF shares in June, according to figures from TrimTabs. That pace was much greater than ever seen before, with the outflows having jumped by more than $32.5 billion in just the past week.

The bulk of the outflows came from traditional bond mutual funds, accounting for more than $70 billion of the outflows. But TrimTabs said that $9 billion came out of bond ETFs, showing that both long-term investors and short-term traders think that the bond-market rout could have further to run.

Where the losses are
The impact of the abrupt rise in interest rates has rippled throughout the various niches of the bond market. In the Treasury market, long-term-focused iShares Barclays 20+ Year Treasury (TLT 0.33%) has sunk by almost 10% since the first of April. Short-term Treasuries have seen smaller-percentage declines, but they've still eaten up multiple years' worth of interest payments in capital losses.

Municipal bonds haven't escaped the carnage, with iShares S&P National AMT-Free (MUB -0.02%) falling about 6% in the past two months. Many closed-end municipal bond funds have taken much worse damage than that, with shares that had previously traded at premiums to net asset value now sporting substantial discounts and resulting in double-digit percentage declines for some funds.

Corporate bonds have also taken a hit, although shorter durations on some of the most popular corporate bond funds have limited their losses compared to longer-term Treasury ETFs. iShares Core Total Bond (AGG 0.32%) has lost between 3% and 4%, while at the lower end of the credit-quality spectrum, SPDR Barclays High Yield (JNK 0.42%) weighed in with a 4.5% loss during May and June. Especially at the higher-yield end, recent losses in the stock market have also contributed somewhat to junk bond declines, since junk bonds share many traits with stocks given their more speculative position in the capital structure than bonds of companies that carry better bond ratings.

Some of the worst declines have come from the international sector, where bonds have suffered the triple hit of falling exchange rates, rising rates, and in some cases, currency outflows as investors become less comfortable with higher-risk areas like emerging markets. Even dollar-hedged international bond funds have seen high-single-digit declines, while the unhedged WisdomTree Emerging Markets Local Debt ETF (ELD 0.43%) sank almost 10%.

Why the herd is being smart
Mainstream investors are notorious for having bad timing, and waiting until after the bond market's recent swoon to start moving money out of bond investments looks bad from a short-term perspective. Recognizing the poor risk-reward picture in bonds could have prevented those losses.

Moreover, further outflows are likely still to come. Some investors will only learn of their bond-market losses once they receive their quarterly statements in the next week or so, and the loss in confidence in what many perceived to be a low-risk investment without the possibility of losing money could drive many to give up on bonds in the same way that many gave up on stocks after the market meltdown in 2008 and 2009.

But as big as these losses are, they're likely just the precursor to potentially larger ones down the road. Even after their big rise, interest rates have far to go before they reach normal levels. Rates may dip briefly after such an abrupt jump, but in the long run, getting investors out of the bond market will save them from what could become long periods of outperformance in the future -- and that could prove to be the silver lining in the bad experience bond investors have suffered over the past couple of months.

The right move for bond investors
If you've held bond funds and ETFs in the mistaken belief that they save you from risk of principal loss, it's not too late to take a critical look at the exposure you have to further interest rate risk and dial it down accordingly. Locking in recent losses might be painful, but the potential traps you avoid down the road could more than make up for those losses.