Many popular weight-loss approaches work at first but actually set you up for long-term weight gain. How? By creating an imbalance in your ­digestive tract microbes, aka your gut microbiome. Common mistakes…

Yo-yo dieting. Dieters often lose a lot of weight and then regain it—sometimes more than they lost. One reason may be that yo-yo dieting harms the gut ­microbiome. In one recent study published in Nature, the microbiomes of animals that lost and regained weight changed in ways that quickened weight regain.

Eating too much or too little fat—or the wrong kinds. While high-fat diets permit harmful gut bugs to thrive, ­going on a low-fat diet can backfire, too. You want healthful fats, which are anti­inflammatory and feed your good bugs. The best anti-inflammatory fats include olive oil and, for high-heat cooking, canola and coconut oils. Eat seafood for gut-friendly omega-3 fatty acids—flaxseeds and chia seeds are good sources, too. On the other hand, minimize your consumption of conventionally raised red meat, which is chockful of inflammatory omega-6 fats. (If you really love meat, go for grass-fed cattle raised on pasture—the meat is lower in inflammatory fats.)

Too little fiber. Too many diets, especially low-carb ones, skip high-fiber foods. But a healthy gut microbiome needs fiber to thrive. Aim for 25 grams to 35 grams a day. Best sources: Beans, cruciferous vegetables (broccoli, cauliflower, kale, cabbage), fruits (especially berries) and oats. Eat a variety of fiber-rich foods to diversify your microbiome.

Artificial sweeteners. Saccharin, sucralose and aspartame may have zero calories, but they change the gut ­biome and not in a good way. Animal and ­human studies link them to weight gain.

The wrong probiotic. If you take a probiotic supplement and are trying to lose weight or keep weight off, look for a product containing Lactobacillus gasseri, Lactobacillus plantarum and/or Lactobacillus paracasei. Even better—eat more probiotic-rich fermented foods such as yogurt, kefir, sauerkraut, kimchi, tempeh and miso.