During pregnancy, everything you put in your body has the potential to affect the health of your developing fetus, for good or ill. For this reason, it's important to be careful about the foods and medications you use. Magnesium oxide is probably safe for use during pregnancy, though the FDA has not assigned it to a risk category. Not having a risk category simply means there is not enough evidence yet to establish one -- it is not proven safe nor harmful and you should speak with your physician before taking.
Most women know that during pregnancy you should avoid taking prescription and over-the-counter medications as much as possible, unless specifically directed otherwise by your doctor. This is because some of the medications you take -- even if they're perfectly safe for you -- can cross the placenta into your baby's bloodstream and negatively impact your developing fetus. The FDA ranks medications based on research that demonstrates or fails to demonstrate their safety in pregnant women, explains AmericanPregnancy.org.
According to PubMed Health, magnesium oxide is used both to supplement women with magnesium and as a laxative. During pregnancy, it's not uncommon for you to become constipated because your digestive tract functions more slowly, which can lead to irregularity. While magnesium oxide is available over the counter, you shouldn't use it or any pharmaceutical without talking to your doctor first.
According to Drugs.com, the FDA has approved magnesium oxide as a magnesium supplement during pregnancy, but the Drugs.com website notes that magnesium hydroxide -- a closely related chemical that forms when magnesium oxide comes in contact with water, as it would in your body -- hasn't been assigned a safety category for use in pregnancy by the FDA. This is because there haven't been large, scientific studies conducted to demonstrate the safety of magnesium oxide in pregnant women. The National Institutes of Health advises that you do not take magnesium oxide as an antacid for longer than two weeks, and do not take it to treat constipation for more than one week without consulting with and getting approval from your physician.
Generally speaking, the information available from the FDA regarding use of magnesium oxide in pregnancy means that while it's probably safe to take it if you need to, you shouldn't use it unless the benefits significantly outweigh the risks. Your obstetrician can help you determine whether your need for magnesium oxide is significant enough to make it worth the risks associated with taking it. Your doctor also can suggest alternative medications that might be more appropriate.