Over the past several years, investors had little use for short-term bond funds, which provided ­paltry yields. But now that interest rates are rising, the funds have become an increasingly attractive alternative to long-term bonds and even certain kinds of stocks, which are more likely to be hurt by rising rates. The funds, which typically hold high-quality government and corporate debt with maturities of one to three years, were recently yielding as much as 2.8%. They are most attractive as exchange-traded funds (ETFs), which charge much lower fees than similar mutual funds. How to use them…

As an alternative to blue-chip dividend stocks. If you fear the bull market will end soon, you can trim your exposure to high-quality dividend stocks, which recently had yields in the 2%-to-2.5% range.

As an alternative to intermediate- and long-term bond funds. Yields on longer-term bonds have risen much more slowly than on short-term ones, so there’s little incentive to own them. Example: The ICE US Treasury 20+ Year Bond Index recently yielded just 2.9%.

Warning: Do not use these as a substitute for holding cash, especially if you need to draw on the money soon. Even short-term bond funds carry some risk in the short term. You could see negative total returns if ­inflation soars and the Federal Reserve has to raise interest rates more aggressively. Recommended short-term bond ETFs now…

Vanguard Short Term Bond ETF (BSV) had a recent yield of 2.8% and an average duration (a measure of interest rate risk) of 2.71, meaning that the fund share price would fall by 2.71% for each one-percentage-point rise in interest rates.

iShares 1-3 Year Treasury Bond ETF (SHY) recently had a 2.4% yield and a duration of 1.94.