Shrimp is generally considered safe to eat during pregnancy, as long as it is fully cooked. Health authorities including the FDA, the NHS, and ACOG list shrimp among the "best choices" of low-mercury seafood and actually encourage eating fish and shellfish in pregnancy. The main cautions are cooking it thoroughly and keeping to the recommended weekly seafood amount.
Shrimp is a low-mercury shellfish that is a good source of protein and omega-3 fatty acids. The FDA and EPA place shrimp in their "Best Choices" category of seafood, the group they recommend most during pregnancy. Omega-3s from seafood support your baby's brain and eye development, which is why authorities encourage seafood rather than avoiding it.
The FDA and NHS advise that fully cooked shrimp is safe in pregnancy and can be eaten regularly within seafood limits. The FDA/EPA recommend 2 to 3 servings (about 8 to 12 ounces) of low-mercury seafood per week, and shrimp fits within this. The NHS notes cooked shellfish is fine in pregnancy; the concern is with raw shellfish, which can carry bacteria and viruses that cause food poisoning.
Cook shrimp until it is opaque and firm, and avoid raw or undercooked shrimp such as in some sushi, ceviche, or raw shellfish platters. The CDC and NHS warn that raw shellfish raises the risk of foodborne illness like listeria and vibrio, which can be more serious in pregnancy. Reheat pre-cooked shrimp until steaming hot, and if you have a shellfish allergy, shrimp remains off-limits as usual.