A South Australian teenager who took photos of his genitals and sent them to his girlfriend — who after their break-up posted one on social media — has been spared a conviction for producing child exploitation material.

The 16-year-old boy, who cannot be identified, pleaded guilty to two counts of producing child exploitation material over the pictures he took in September last year and sent to his then girlfriend.

The Youth Court heard his relationship with his ex-girlfriend became acrimonious and she posted the picture on Instagram with the caption "let's share the f**k out of it".

The court heard that led to the police getting involved.

The boy's lawyer told the court the boy was apologetic when he was spoken to by police and made full admissions, telling them: "I've learnt my lesson and will never do it again."

Youth Court Judge Penelope Eldridge said it was concerning to see so many of the cases before the court, and said the girlfriend had also played a significant role.

"These are very, very serious charges and they are rightly regarded to be so and unfortunately they are too frequently coming before this court," Judge Eldridge said.

"I accept you are remorseful and obviously wish it never happened, and I accept it would probably have never come to light if not for the fact that your relationship with your ex-girlfriend was acrimonious and she published the picture."

Judge Eldridge told the boy that, nevertheless, he should not have taken the photos and it was "inappropriate" behaviour.

The prosecution conceded the case was at the lower end of the scale of seriousness for that type of offending and the judge said she was prepared to exercise her discretion not to record a conviction.

"I urge you just not to engage in this sort of behaviour again," Judge Eldridge told the boy.

She placed the boy on a 12-month supervised obligation order to ensure he received support and guidance.

The court did not hear whether the boy's girlfriend was also charged and the ABC has contacted SA Police for a response.