Medics are being warned to take extra care when using social media such as Facebook and Twitter.
The British Medical Association guidance highlighted a series of potential pitfalls doctors face.
In particular, it said there was a risk the lines between personal and professional lives could be blurred.
It comes after a series of cases in which NHS staff and other public sector workers have got into trouble through their use of social media.
In 2009, a group of doctors and nurses were suspended for posting pictures of themselves on Facebook lying down in unusual places, including a hospital helipad.
And last year a civil servant found herself in the newspapers after using her Twitter account to make political points and saying she was struggling with a hangover.
Dr Tony Calland, chairman of the BMA's medical ethics committee, said: "Medical professionals should be wary of who could access their personal material online, how widely it could be shared and how it could be perceived by their patients and colleagues."
The guidance advises both doctors and medical students to adopt conservative privacy settings where they are available.
It also warns them against making informal or derogatory comments about patients or colleagues as well as not accepting current or past patients as friends on Facebook.
The message was echoed by the Nursing and Midwifery Council (NMC), which has also issued its own guidance this week.
NMC official Andy Jaeger said: "What you regard as just an amusing story could end up causing serious offence more easily than you think."