His life is in the crapper!

The ex-New Jersey superintendent who was outed as the school’s “mystery pooper” said cops defiled his name by leaking his mugshot — which quickly went viral.

The lawyer for Thomas W. Tramaglini — who pleaded guilty in October to defecating under bleachers on Kenilworth Public Schools property — called for an investigation Monday into the Holmdel police department.

His attorney said the department’s “unauthorized taking and subsequent leaking” of the 42-year-old superintendent’s mugshot turned him into a punch line.

“[Thomas Tramaglini’s] life, effectively, has been ruined,” Matthew Adams wrote in a letter to New Jersey Attorney General Gubir Grewal.

Police identified the school honcho in May 2018 as the suspect responsible for the “human feces” found near Holmdel High School’s track field on a “daily basis.” The department posted his mugshot to Facebook after using surveillance footage to catch him in the act on a run.

“The photograph gave traction to inaccurate media accounts that he had been charged with some deranged, anti-social behavior,” wrote Adams in the letter, which claims his client relieved himself in public due to a “medical emergency.”

Travaglini’s lawyer griped that police released his mugshot before he was charged with a criminal offense — and swiftly humiliated the school head who resigned last July after a 20-year career. His case went viral and earned him the moniker “the Pooperintendent of Schools.”

“There is no way for Dr. Tramaglini to cleanse the internet of what the Holmdel Police Department has so maliciously done to harm him, and the Holmdel Police Department must be held accountable,” Adams wrote in the letter.

Tramaglini has defended himself, saying he suffers from a documented medical condition known as “Runners Diahrrea” when he jogs.

“It’s been getting worse as I’ve gotten older,” Tramaglini told NJ.com. “But I run 40 miles a week and it’s not like it happens all the time.”