A stand-up comedian jailed for six weeks for throwing shaving foam at media mogul Rupert Murdoch had his sentence cut to four weeks by a British court on Friday.

Jonathan May-Bowles, a 26-year-old who calls himself Jonnie Marbles, was seeking to overturn the sentence he received this week for the attack on the 80-year-old News Corp. chairman.

Judge Anthony Pitts rejected the attempt to throw out the sentence, but told Southwark Crown Court in London that the district judge in the first hearing had failed to give enough credit for May-Bowles' guilty plea.

May-Bowles admitted attacking Murdoch on July 19 during a parliamentary hearing on phone hacking by his News of the World tabloid.

The judge rejected arguments that the foam pie attack was in the tradition of comics from Laurel and Hardy to Monty Python.

"That might be funny or have an element of comedy about it in a different situation," he said.

"But not in this situation. It was intended, it seems to us, to cause fear and it must have caused fear.

"In our judgment, there is an overwhelming inference it caused fear and shock amongst Mr Murdoch, his wife and his son, let alone others in the room who were crying out in shock and disbelief."

Some of the foam on a paper plate hit Murdoch despite the efforts of his Chinese-born wife Wendi Deng, who leapt up and aimed a slap at May-Bowles' face as he rushed from the public gallery.

Murdoch shut down the 168-year-old News of the World on July 7 after it emerged that a private investigator working for the newspaper had hacked the voicemail of a missing 13-year-old girl who was later found dead.

The phone hacking scandal has also forced Murdoch to drop his bid for full control of satellite broadcaster BSkyB.