Teachers must either exercise the "most diligent discretion" or "steer well clear" of social networking websites such as Facebook and MySpace, according to the vice-president of the Association of Directors of Education in Scotland.
However, Leslie Manson admitted he had an account on photo-sharing website Flickr and therefore would never say, "Don't do it".
Mr Manson, who is director of education in Orkney, made his comments after a secondary teacher in Argyll and Bute posted messages discussing pupils and staff on a social networking site during working hours.
The principal teacher of modern languages is being investigated by the council after using website Twitter to post short messages about what she was doing up to 38 times a day.
The internet had turned Scotland into a "big village", Mr Manson said. Teachers who lived in small communities, such as those in Orkney, had to exercise an "added dimension of discretion" when they were relaxing because they were more likely to bump into pupils and parents. The same applied to teachers on the net, he argued.
"Thanks to websites like ratemyteachers.com, the anonymity teachers might have enjoyed in the past is not so prevalent," he said.
He recommended that school staff consider the advice from their authority and their regulatory body's code of conduct.
The General Teaching Council for Scotland highlighted for the first time the potential dangers of social networking websites when it issued new guidance to teachers last year.
The new standards for the profession - the Code of Professionalism and Conduct - advised teachers to "exercise extreme caution" in relation to "contactweb cam internet sites", such as chatrooms, and to avoid "sending emails or text messages to pupils of an inappropriate or personal nature".
Mr Manson did not see social networking sites as a huge problem for teachers, however. The vast majority approached such sites with "good sound judgment", he felt.
However, a significant number of teachers have fallen foul of social networking sites in the five years since they came into being, said Duncan Murray, a partner and employment law specialist at law firm Morton Fraser, who advises the Scottish Secondary Teachers' Association. He advised teachers to "avoid getting involved".
"There have been a number of cases where there have been issues arising from social networking in terms of communication with pupils," he said.
The GTCS guidance raised awareness of the issue, particularly among younger teachers accustomed to using the sites, he felt.
The Argyll and Bute teacher's twittering was exposed by a local newspaper last week. It reported the teacher had been posting an average of 20 short messages, known as "tweets", a day since December.
Users post the short messages, using up to 140 characters, to tell each other what they are doing.
In one tweet, she said there was "never a dull moment" with "three Asperger's boys" in her S1 class. In another, she reported she was "stuck in a maths cover lesson", and in a third, she appeared to appreciate that what she was doing was potentially controversial, writing: "Depute came in while I was logging on. won't stop me unless I'm told not to."