Social media users have been warned about the consequences of breaching an injunction banning the revelation of the new identities of James Bulger's killers.
The High Court said nine-month prison sentences, suspended for 15 months, imposed on Dean Liddle and Neil Harkins were not only to punish them but to deter others.
Sir John Thomas, President of the Queen's Bench Division, said the court would take the exceptional course of suspending the sentences in this case, but there was little prospect of an offender avoiding a very substantial immediate custodial sentence if there was any future similar publication.
Attorney General Dominic Grieve brought contempt proceedings against Liddle and Harkins, who put photos on Twitter and Facebook respectively in February this year, two days after the 20th anniversary of the toddler's murder, which purported to depict Jon Venables and Robert Thompson as adults.
They admitted breaching a January 2001 injunction, binding on the whole world, imposed before Venables and Thompson were released, which prohibits the solicitation or publication of any information purporting to identify their physical appearance, whereabouts, movements or new identities.
Mr Grieve said the public interest required its enforcement to mitigate the "very real risk of serious physical harm or death" to anyone who might be identified, whether correctly or incorrectly, as being either of the killers.
Sir John, sitting in London with Mr Justice Tugendhat, said that Liddle, 28, of Sunderland, Tyne and Wear, and Harkins, 35, of Bridlington, East Yorkshire, became part of a "determined Internet campaign" on the anniversary.
He said: "They joined in that campaign and we cannot accept it is in any way exculpatory that others were doing it. In the view of the court, their conduct has to be judged on the basis that they knew what they were doing was wrong, and it was no excuse that others were doing it."
He added: "Vigilantism has no place in a civilised country and it is for the purpose of deterring such conduct that we must have particular regard."
Harkins, who had 141 friends on Facebook with his post being shared 20,000 times, made no comment, while Liddle, who had 915 followers on Twitter, said: "I am just going to go home and see my son."