MADELEINE MCCANN PARENTS WANT JAIL FOR EX-SOLICITOR'S ‘SLUR’
Madeleine McCann: Legal action over cover-up allegations
Tony Bennett, from Harlow in Essex, had previously agreed not to publish allegations linking the girl's parents to her disappearance.
He did so in an undertaking at the High Court in London in 2009, but he is alleged to have breached this 26 times.
Mr Bennett denies breaching the High Court ruling.
Giving evidence at the High Court, Mr Bennett said if he had "trespassed", then he would "like to apologise to the court".
"I was at no time deliberately trying to flout the undertaking," he said.
The judge will deliver his verdict on whether Mr Bennett is in contempt of court at a later date.
The court heard Mr Bennett wrote to Prime Minister David Cameron alleging Kate and Gerry McCann were involved in their daughter's disappearance, then published the letter online in May 2011.
Mr Bennett also wrote to Home Secretary Theresa May and Det Ch Insp Andy Redwood, the Scotland Yard detective leading the UK police review into the Madeleine case, and published these letters online.
Adrienne Page QC, representing the McCanns, said there was no complaint about Mr Bennett writing the letters.
However, she said: "The complaint is the publication to the world at large.
"This is advocacy, espousing, campaigning for the McCanns being involved in a cover-up and lies."
Madeleine disappeared when she was three years old in Praia da Luz in May 2007.
At one time Kate and Gerry McCann, from Rothley in Leicestershire, were made suspects by the Portuguese police, along with another man.
In July 2008 the Portuguese Attorney-General said there was no evidence linking her parents to any crime.
Ms Page said the McCanns had not brought the court action to punish Mr Bennett or send him to prison.
She said: "They want to put a halt to the persistent breaches of the undertaking by Mr Bennett."