Sir John Thomas sitting at the High Court ruled that the two men were in breach of the injunction and therefore in contempt of court.
Reflecting on the "gravity" of their offence he said they would be given nine months imprisonment but because of mitigating circumstances it would be suspended.
More top news
Two murderers who wed in Britain's first gay prison marriage will not be allowed to share a cell.
Facebook has completed its first test of a solar-powered drone that carries internet signal in the skies above the UK.
Russia goalkeeper Igor Akinfeev has thanks fans for their support after he was struck by a flare thrown during a qualifier in Montenegro.