In some cases, taking antibiotics before traveling can help prevent traveler's diarrhea. Early treatment with antibiotics may also shorten an episode of traveler's diarrhea. If you are planning a trip to a developing country, talk to your healthcare provider about medicines to prevent diarrhea.