Charities are set to miss out on millions of dollars paid to them by court orders following a landmark court ruling.

The ruling means Victorian magistrates and judges will no longer be able to order a person to make payments to charity as part of an adjourned undertaking or good behaviour bond, after the City of Melbourne successfully challenged the practice.

The council challenged a magistrates court decision that required a man who was guilty of breaching the Food Act to donate $2500 to St Vincent de Paul's food van service.

It is common practice for magistrates to require offenders to make a payment to charity when they release them without conviction.

On Tuesday Victorian Supreme Court Justice John Dixon ruled the magistrate erred when he required the man to make payment to St Vincent de Paul as a condition of his adjourned undertaking because such a condition was not within his powers.

Pilch, an organisation which appeared as a friend of the court in the case, says the decision threatens the millions of dollars charities receive each year from the court fund.