When you transition to a ketogenic diet, it is normal for some people to experience digestive issues - either diarrhea or constipation . These issues generally only last for a few days, but there are things you can do to help. Stay hydrated, take probiotics, and include low-carb vegetables in your keto diet menu.
If you’re experiencing constipation:
Take a magnesium supplement (magnesium citrate) 
Stay hydrated by drinking water and herbal tea
Eat plenty of leafy greens and non-starchy vegetables
Take psyllium husk, flax, or chia seeds for extra fiber
If you’re experiencing diarrhea:
You might be eating too much fat.
If you have digestive issues, don’t go over 80% of calories from fat and avoid coconut oil and MCT oil.