A high court judge has issued an injunction which for the first time explicitly bans publication of information on Twitter and Facebook.

The order, made by Mr Justice Baker in the court of protection – linked to the family division of the high court – places a specific ban on publishing information on any "social network or media including Twitter or Facebook", as well as in other media.

The normal orders issued by the family division judges to prevent identification of children and others involved in cases simply ban publication of specified information in "any newspaper, magazine, public computer network, internet website, sound or television broadcast or cable or satellite programme".

The decision follows the publication on Twitter over the weekend of a number of tweets purporting to reveal the identities of celebrities involved in "superinjunctions", which wrongly named Jemima Khan as one of them.

The tweets brought warnings from leading lawyers that if the person involved was discovered and were based in the UK – which is presently impossible to ascertain – that they could face a jail sentence. The US company running Twitter has not commented

Twitter's UK traffic rocketed to its highest level ever on Monday 9 May, apparently as people searched for the names.

Mr Justice Baker issued the order in a case involving a woman, who can be referred to only as "M", who has been in "a minimally conscious state" since suffering from swelling of the brain stem, which caused serious damage and wasting to the brain.

M suffered the illness in 2003, when she was 43, and has been minimally conscious since.

Her mother applied to the court of protection, which deals with cases of those who are unable to make their own decisions on medical care or other issues, for an order that those who are looking after M could withdraw nourishment and medical treatment and allow her to die, while giving her the care and treatment she needed to suffer the least distress and maintain as much dignity as possible.

Mr Justice Baker had issued one injunction in the case which banned the media not merely from publishing information which could identify anyone involved in the case, but also from contacting a list of 65 people who were connected with it, including M's relatives and care home staff.

Though it is highly unlikely that anyone would seek to name the woman involved in the case cited in Mr Justice Baker's order, the move sets a precedent that is likely to be made explicit in future injunctions and superinjunctions.

However, that could be difficult to enforce because both Twitter and Facebook are US companies, which could argue that their users are exercising their right to free speech, which is guaranteed under the US Constitution's first amendment. If the poster were an American, they might be able to evade UK law entirely, despite being in contempt of the British court.

The culture secretary Jeremy Hunt said on Wednesday that he would "sit down" with the justice secretary, Ken Clarke, to review the regulatory environment arising from the superinjunctions case and the Twitter account, calling it "a crazy situation ... where information is available freely online which you are not able to print in newspapers".

The court of protection rules specify that cases are normally heard in secret. But it does allow for exceptions in which cases can be heard in public, subject to reporting restrictions protecting the identities of the parties.

Recent cases in the court which have been reported included one about who took responsibility for the financial affairs of the blind and autistic prodigy pianist Derek Paravicini, and another involving allegations that the London Borough of Hillingdon breached the human rights of Mark Neary, a 20-year-old man with autism and learning difficulties, when it removed him from his father's care and placed him in a care home.

• To contact the MediaGuardian news desk email editor@mediatheguardian.com or phone 020 3353 3857. For all other inquiries please call the main Guardian switchboard on 020 3353 2000. If you are writing a comment for publication, please mark clearly "for publication".

• To get the latest media news to your desktop or mobile, follow MediaGuardian on Twitter and Facebook