It’s going to be a lot harder to suspend unruly students under the first overhaul of the public-school disciplinary code announced Friday by the de Blasio administration.

No longer will inappropriate clothes, profanity and insubordination earn students an automatic boot from class.

Principals will have to get permission from the Department of Education run by Chancellor Carmen Fariña before kicking out kids who talk back to teachers.

Superintendents’ suspensions for “minor physical altercations” are being eliminated entirely.

Cops and school safety officers will need a supervisor’s permission to handcuff a kid under 12, except in emergency situations.

And in a pilot project at five Bronx schools, disruptive kids will get “warning cards” instead of summonses returnable in court.

Mayor de Blasio, who vowed to reduce unnecessary suspensions and arrests when he ran for City Hall, said the new policies would “treat students of every background with dignity.”

“No parent should have to choose between a school that’s safe for their child and a school where every student is treated fairly,” he said.

The new code is scheduled to kick in after a public hearing on March 2.

Advocates were demanding reforms, pointing out that 89 percent of suspensions are handed out to black and Hispanic students, even though they comprise only 70 percent of the system.

The principals union raised immediate objections to reducing the authority of principals in their own schools.

“When it comes to what, if any, consequences are in the best interests of a student, the principal is best positioned to make that call,” argued Mark Cannizzaro, vice president of the Council of School Supervisors and Administrators.

Former deputy chancellor Eric Nadelstern said it wasn’t a good idea to reduce penalties for “minor” scrapes between students.

“What you want to communicate is no pushing, shoving or fighting, not that some types are permissible,” he said. “Saying that there are some types that are not serious while other types are serious is problematic.”

There were 4,000 fewer suspensions in the first six months of de Blasio’s tenure in 2014, compared with the same period in 2013.