Xanthan gum is ubiquitous in gluten-free baking. Gums like Xanthan and Guar are meant to replace the stickiness of wheat gluten which binds the particles of flour and other ingredients together. Without a binder, bread falls apart in crumbs instead of holding together in a slice.
Unfortunately, many people have trouble with gums in the quantity used in gluten-free baking, including symptoms like bloating, cramping, constipation, and other digestive upset. In addition, gum can give baked goods an unpleasant aftertaste and pasty feel in the mouth, even enhancing the grittiness of rice flours.
I've been experimenting with replacement binders, and the best I've found is milled (ground) chia seeds. They're inexpensive (about half the price of xanthan gum!) easy to find on Amazon or in health stores, and substitute 1:1 for xanthan gum. You can also buy whole seeds and grind them in a coffee grinder, in which case measure the ground seeds, not whole.
To use, you take the same amount of chia seeds as the recipe calls for in xanthan gum, or 3/4 of the amount called for in guar gum. Mix the seeds with twice as much hot water and let sit until it forms a thick gel. Add the gel to the other ingredients and mix really well (for breads, use a stand mixer and mix for at least 3 minutes on medium speed). Add 15 minutes to the baking time called for in the recipe, but check after 10.
As an example, I successfully used ground chia seeds in my favorite gluten-free french bread recipe from Simply Gluten Free. As the recipe calls for 3 teaspoons of xanthan gum, I instead used 3 teaspoons of ground chia seeds in 6 teaspoons of very hot water. I let it gel, then added it with the other wet ingredients. I added 15 minutes to the bake time.
The results were much better than with the gum; super moist and chewy bread with no aftertaste or gummy feel. The chia did add a barely noticeable, but pleasant nutty flavor. I used black chia seeds, so if the flavor is an issue, try white chia instead.
The bread was super-moist. If your baked good is already very moist (like cake) you may want to eliminate some liquid to balance the addition of the chia. I would leave out liquid equal to the amount of hot water you used in the chia, and then check at the normal bake time to see if it needs the additional 15 minutes.
Note that if you are already using chia or flax as an egg substitute, you may be able to simple leave out the gum and have the recipe turn out just fine! Try it before you bother adding additional seeds.
The downside: Baked goods with Chia seem to stale out faster (not that any gluten-free baked good really lasts). The bread I made yesterday is a bit crunchy today, but refreshed well in the microwave. I would count on, as soon as it's cool, either crumb-sealing cakes and cupcakes or freezing them. Wrap bread tightly and refrigerate, or slice and freeze. You can also let it stale out and make it into stuffing, french toast, bread pudding, casserole, etc. the next day.