A difficult May in the municipal bond market has put investors on the defensive.

Faced with rising yields, falling valuations relative to Treasuries and lower issuance, analysts and portfolio managers are advising muni investors to lessen risk, shorten duration, diversify, and restructure porfolios to reduce overall volatility.

“May broke all the rules,” said Priscilla Hancock, municipal strategist at JPMorgan Asset Management. “In May, rates were up and inflation was down. High-yield spreads widened; they traditionally tighten when rates are up.”

Yields have jumped even though issuance has been meager, falling 28% in May from a year earlier and 3% for the year to date. The value of munis has continued to fall as tax-exempt yields at the 10-year and 30-year parts of the curve rose 60 basis points and 70 basis points, respectively, since May.

Outflows from muni bond mutual funds jumped to $1.47 billion from $157 million over the past two weeks.

Where should existing bondholders look for safety? For starters, don’t panic, Hancock said.

In May, the market may have seen a good part of the price movement for the whole year, she said. Investors “shouldn’t annualize May and assume that’s going to happen every month for the next 12 months,” Hancock said. “And they have to really look at the annual coupon against the price movement.”

They should also reevaluate the risky parts of their portfolio and take some of that risk off the table, she said. This could mean selling high-yield munis, and some of the other lower-rated, less-liquid sectors.

Investors should consider diversifying their portfolios. Most investors own a traditional intermediate tax-free fund, a separately managed account or a laddered portfolio.

Generally, they don’t own much that isn’t correlated to those core intermediate holdings, Hancock said, credits that will help offset risks of rising rates. Investors might also want to explore absolute return strategies of the variety hedge funds employ, as well as inflation hedges, Hancock said.

“Traditionally, 50% of every rate rise is attributable to a rise in inflation,” she said.

Clients who moved out the curve to pick up yield and now are worried about rising rates could tighten their duration. And those with portfolios structured all of par bonds, may not be prepared to weather a rising-rate environment; when rates rise the prices of par bonds fall quickly, and premium bonds will outperform them.

Broadly speaking, it’s sensible for muni investors in today’s environment to have some credit exposure, said Terry Hults, portfolio manager for tax-exempts at AllianceBernstein. This could include some high yield and triple-B-rated credits, or for high-grade-type investors, moving heavily into single-As.

Income generated through increased credit exposure can offset a potential rise in rates, Hults said. And if rates don’t rise, “you’re earning more carry, or income, along the way,” he added. “Both are defensive measures.”

In the lower-yield environment that preceded the recent sell-off, investors were tempted to stretch out the average maturities of their portfolios, Hults said. But given the call features of those types of bonds, and their subsequent negative convexity, exposure to lower coupon, high-grade bonds longer than 15-to-20 years isn’t recommended, he added, depending on the strategy.

The recent market selloff also caused the slope of the muni bond yield curve to steepen by a substantial 35 basis points, to 309 basis points, John Dillon, chief municipal bond strategist at Morgan Stanley Wealth Management, wrote in a research report.

This volatility reinforces the need for investors to limit duration in their muni portfolios; the slope of Morgan Stanley Wealth Management’s current target range of between five and 11 years steepened by just 14 basis points during the same timeframe.

Yields beyond the front end of the curve have indeed risen above their averages for 2013. The 10-year has averaged 1.83% for the year through June 11, when it rose to 2.26%, Municipal Market Data numbers showed. And while the two-year approaches its average for the year of 0.31%, the 30-year, at 3.49%, has soared past its year-to-date average of 2.96%.

For perspective, the 10-year still falls well below its average since 2008 of 2.72%. The same holds for the yields of two-year and 30-year triple-As.

Investors should watch their portfolios carefully, Dillon said. And they should increase their exposure to high-credit munis, particularly mid-tier A or higher-rated general obligation bonds, as well as mid-tier triple-B or higher-rated essential service revenue bonds of the water, sewer and electric variety.