A fast food company has been fined $21,000 for selling hot chips that contained metal shavings.

In the Perth Magistrates Court today, Red Rooster pleaded guilty to a charge of selling food that was unsuitable at its store on Walter Road East in Morley in April.

The shavings were found by a customer when he bit down on a chip.

The court was told the shavings were a result of maintenance work that was done on a chip warming machine while it was still in operation.

The company's lawyer said the work was not done in compliance with Red Rooster policy which required that machinery be shut down and moved to another location for maintenance, and then thoroughly cleaned after the work was completed.

She told the court it was an isolated incident.

"This ought not to have happened but happened because of an incorrect decision made by individuals," she said.

"The manager has been sacked as a result of non compliance."

Magistrate Colin Roberts said the offence was made more serious because the customer had actually bitten down on a metal fragment.

"It was lucky no medical treatment was required," he said.

However, he said Red Rooster had pleaded guilty and expressed regret.

As well as the fine, Red Rooster was ordered to pay more than $2000 in court costs.