People who criticize the Turkish government online are risking jail in Turkey, Germany's foreign ministry said in its new travel advisory, warning that visitors from Germany have also been "arbitrarily imprisoned" in recent years.

"Arrests and prosecution of German nationals have been repeatedly linked with anti-government criticism on social media," the ministry said. "In some cases, it is enough to share or 'like' a post with such content."

Even private messages could be passed on to the Turkish authorities via anonymous informants, according to German officials.

Expressing support for the Gulen movement or the Kurdish militias, both classified as terror organizations in Turkey, could also be cause for arrest. If a person is found guilty of "insulting the president" or "propaganda for a terrorist organization," they could face years in prison.

Germany also urges its citizens to stay away from political events and "from big crowds in general."

Cell phones confiscated

The ministry also said that many German citizens have been denied entry to Turkey without explanation since the beginning of 2017. A large percentage of these people have close family and personal links with Turkey, as wells as Kurd or Alevi background.

Read more: Reporters Without Borders: 'A dark day for press freedom' in Turkey

"The affected individuals were forced to travel back to Germany after waiting in custody between several hours to several days," according to German officials. "In such cases, their cell phones were confiscated and searched for saved content and contacts."

Read more: Turkey's Erdogan lands in Berlin for contentious state visit

Over 20 German citizens have been arrested in Turkey since the failed military coup in July 2016. While some of them have been freed, tensions between Berlin and Ankara remain high.

Turkey-based activists also reported arrests of people who criticized Ankara's military intervention in Syria, the anti-Kurd military campaign, or Turkey's poor economic performance this year.

dj/rc (Reuters, dpa, AP, AFP)

Each evening at 1830 UTC, DW's editors send out a selection of the day's hard news and quality feature journalism. You can sign up to receive it directly here.