The attorney general said they had engaged in a "feeding frenzy". The Mirror has said it will appeal.
Mr Jefferies, who was innocent, also accepted an apology and "substantial" libel damages from eight newspapers.
His lawyer, Louis Charalambous, described his client as "satisfied" with the outcome.
'Witch-hunt' "Christopher Jefferies is the latest victim of the regular witch-hunts and character assassinations conducted by the worst elements of the British tabloid media," he said.
It is thought to be the first time that media organisations have been found guilty of contempt with a story about a suspect who was not, ultimately, tried.
Attorney General Dominic Grieve welcomed the contempt judgement, which saw both newspapers liable for substantial costs.
"These two newspapers completely lost the plot, they engaged in a feeding frenzy over the new year period," he said.
He said it acted as "a reminder to the press that the Contempt of Court Act applies from the time of arrest".
The act aims to prevent potential jurors from becoming influenced by press and broadcast reports.
Contempt of court in English Law
- Laws exist to protect the integrity of the legal process
- A criminal case becomes "active" when a person is arrested or a warrant issued
- Once a case is active, no material must be published or broadcast which might prejudice a trial, by influencing the jury
- Photographs can prejudice a case when there is a dispute over the identity of a culprit
- Courts have given reporters more leeway in recent years, recognising that passage of time lessens the risk of "substantial" prejudice
- Internet archived reports or sensationalist reporting heighten the risk of prejudice
Mr Jefferies was arrested on suspicion of murder on 30 December but later released without charge.
Miss Yeates' neighbour, Dutch national Vincent Tabak, 33, has since admitted her manslaughter and awaits a murder trial.
However, some press coverage in the aftermath of Mr Jefferies' arrest was found to have cast doubt over his character.
Among the suggestions - all untrue - were that he was prone to invade the privacy of his tenants and had acted inappropriately with pupils when teaching.
The Lord Chief Justice, Lord Judge, told the contempt hearing that two articles in the Mirror had "vilified" Mr Jefferies, painting him as an "eccentric loner".
Trial 'impossible' They had asserted he had been involved in unacceptable sexual behaviour and was linked both to paedophile offences and a 1974 murder, he said.
"These articles would have provided Mr Jefferies with a serious argument that a fair trial would have been impossible," the judge added.
Libel laws in England and Wales
- Exist to protect the reputation of individuals and corporations from unjustified attack
- Cover written publications, pictures and broadcast material
- Generally speaking, apply to statements that expose someone to hatred, cause them to be shunned, lower them in others' estimations or disparage their work
- Defences to libel action include proving the statements are substantially true or are "fair comment" - meaning they are honest opinion based on true facts
- Many cases are settled out of court because of the difficulty and expense of proving and defending claims
Earlier, the Sun, Mirror, Sunday Mirror, Daily Mail, Daily Record, Daily Express, Daily Star and the Scotsman agreed a settlement with Mr Jefferies over his libel claims.
A separate hearing was told that the newspapers now accepted Mr Jefferies had nothing to do with Miss Yeates' death and had helped police as much as he could.
There was no basis to suggest, as some reports had done, that he had ever acted inappropriately with any pupil while a teacher, they conceded.
Mr Jefferies had taught English at Clifton College in Bristol for 34 years and was of good character, the court heard.