The Attorney General has warned social media companies not to publish information that risks undermining criminal trials, after a string of high-profile cases were threatened with collapse by posts online.

Michael Ellis QC MP has launched a new public awareness campaign to educate people of the legal consequences that could come from posting prejudicial information on the internet.

He has also issued a warning to the social media companies themselves.

Mr Ellis said: “It is important that social media platforms, like other media organisations, do not publish information that could prejudice court proceedings and perhaps lead to aborted trials.

"Aborted trials affect not only the defendant, but also the victims and witnesses who may then have to go through an often-traumatic experience all over again.”

The campaign comes after court cases were being disrupted due to members of the public making comments on social media, with the Attorney General’s Office warning that “while many social media users understand what can and can’t be posted online in relation to active cases, it is clear that some do not”.

Most recently, following the disappearance of Sarah Everard and the subsequent arrest of a serving police officer there was a large amount of speculation about what had happened on social media, which risked interfering with the case.

A serving police officer has admitted kidnapping and raping Sarah Everard, the marketing executive who went missing near Clapham Common several weeks ago

Credit: Family Handout/PA Wire

As a result, the Attorney General was forced to issue a media advisory notice warning everyone not to publish material which could jeopardise a fair trial.

The new #thinkbeforeyoupost campaign aims to highlight the dangers of committing contempt of court online. The campaign will provide advice and guidance on what information, if posted publicly, could leave social media users at risk of being held in contempt of court.

Announcing the campaign, Mr Ellis said: “Everyone is innocent until proven guilty, and everyone deserves a fair trial. The issue is really about discussing matters which should only be raised for the first time in front of the jury.

“A mis-judged tweet or post could have grave repercussions and interfere with a trial. A post on social media could mean a trial is delayed or at worst stopped because a fair trial isn’t possible – so I would caution everyone, don’t get in the way of justice being done.

“It is not only journalists or lawyers who can be found in contempt of court, ordinary members of the public can also do so and find themselves facing their own legal consequences.”

High-profile social media interference with court cases

Earlier this month, Craig Murray, a journalist and former diplomat, who was found to be in contempt of court for publishing material relating to the trial of former First Minister of Scotland, Alex Salmond, was refused permission by the High Court of Justiciary to appeal his case to the Supreme Court.

He was found to have published material that was likely to lead to the identification of the complainers in the trial.

In 2012, two national newspapers found guilty of contempt of court over their coverage of Levi Bellfield’s conviction for the murder of Milly Dowler were fined.

Examples of contempt of court from the Attorney General

The Daily Mail and Daily Mirror were each fined £10,000 by two judges at the High Court in London in a case brought by Attorney General Dominic Grieve.

When the articles were published, jurors had still been considering a separate attempted abduction charge.

They were discharged after coverage of the verdict was considered prejudicial. During the contempt case earlier this year, the judges were told that stories in the Mail and Mirror were part of an "avalanche" of adverse publicity that followed the guilty verdicts against Bellfield.

Contempt of court refers to behaviour that undermines or prejudices court proceedings or interferes with the administration of justice, or creates a real risk of that happening. The same rules apply to members of the public as they do to journalists, especially when posting on social media.

Contempt of court can be punished by a fine, or up to two years in prison.