The end of the year is in sight, and soon countless investors will start selling losing stocks in order to gain tax writeoffs. The practice, known as tax-loss harvesting or tax-loss selling, is extremely popular because it's essentially free money: Stocks (or bonds in some cases) are sold at a loss in order to offset the capital-gains tax bill created when winners are sold. The result is that your tax bill is slashed and you keep more of your money in your pocket.

For years, I've recommended and executed tax-loss selling for my clients, just as the vast majority of financial advisors have. But I plan to be more selective this year and won't sell positions that I like purely for the tax benefit. I'll harvest tax losses where it makes sense; for example with positions that I've lost confidence in. But I think the long-term potential for stocks I believe in outweighs the attractiveness of short-term tax savings.

A big reason I'm less enamored of tax-loss selling has to do with changes in market behavior. Traditionally, the massive year-end selling to harvest tax losses has led to lower security prices. Once the new year begins, the names that sold off in December—and are now cheap—have become buying targets. If investors purchase them soon enough, the continuing buying demand pushes up these stocks' prices to pre-selloff levels and nets a quick profit. That's known as the January effect.

Unfortunately, this strategy has become a victim of its own popularity. These days, the stocks that sold off in December are snapped up incredibly fast in January—often with the help of automated buying programs. The buying pressure drives up prices so quickly that it's become very hard to find them "on sale."

Compounding the problem is the "wash-sale rule." It prevents investors from claiming a loss on the sale of a security if a substantially identical security is repurchased within 30 days. The fact that you can't buy back the same security you've sold for 30 days means that, too often, you're waiting to make the trade while watching the price creep up a little further every day. Thus, the rationale for selling good stocks just for tax purposes has gotten a lot weaker.

If the goal is to maximize your wealth over the long term—and almost all investors should be focused on the long term rather than quick profits—then it's best to be very judicious about tax-loss harvesting. If a holding just doesn't seem like it will work out, then selling it for a tax advantage can definitely make sense. But holding those you believe in makes more sense than ever.