Is there any difference between ‘prohibit’ and ‘bar’ when the two words are used to express the meaning ‘to stop officially from doing sth’?
'Ban' is normally the action of forbidding something by the law or a social rule. As I believe, the best synonym of this word would be 'censor'.
'Prohibit' is a verb very similar to 'forbid'. They mean the same, yet the former sounds more official and might also come with some law enforced penalties.
The main difference between 'bar' and 'ban' is that the latter usually applies to things, and the former usually applies to people.
According to Oxford Living Dictionary 'bar' and 'prohibit' are synonyms:
// Prevent or prohibit (someone) from doing something or from going somewhere.
‘journalists had been barred from covering the elections’
// Formally forbid someone from doing something.
‘he is prohibited from becoming a director'.
As we see from this 'PROHIBIT' is more formal than 'BAR'.