As NYC schools face more violent threats, principals and the NYPD have issued more emergency orders for students to stay put in classrooms and school buildings to be locked tight.

Schools were locked down 90 times in the 2016-17 school year. That’s a 41 percent increase over the 64 lockdowns the year before, Department of Education data shows.

During lockdowns, schools halt movement while staffers and police look for intruders or other threats inside buildings.

In September, students at the Urban Assembly School for Wildlife Conservation were locked down when a 15-year-old was stabbed to death. During lockdowns, teachers are expected to lock classroom doors, shut off their lights and close shades or blinds. Students are ordered to hide and keep quiet.

A less severe type of lockdown, called a shelter-in-place, declined during the 2016-17 school year, data shows.

Shelter-ins were ordered 192 times during the 2016-17 year. That’s a drop of 12 percent from the previous school year. Shelter-ins are imposed when threats exist outside school buildings.

During shelter-ins, students must stay inside, and all building doors are locked. But classes continue as normal.

So far this school year, shelter-ins are sharply up, while lockdowns are fewer than last year. The DOE would not divulge what prompted the precautions.

Between July 1 and Dec. 22, school officials ordered 141 shelter-ins and 25 lockdowns. Together, that’s a 33 percent increase over the same period last school year.

Mona Davids, president of the New York City Parents Union, was “shocked” by the numbers and called on the city to post the details on the Department of Education website. “They are purposely keeping this safety information away from the parents and the public,” she charged.

Kenneth Trump, a Cleveland-based school safety consultant, agreed that officials should give parents more data. “There’s no need to sugarcoat the reasons” for lockdowns he said.

Sam Pirozzolo, a Staten Island school leader, said the schools should do more than hunker down to protect students and staff.

“Our schools are a soft target,” said Pirozzolo, who wants retired cops in plainclothes to guard schools. While the city makes a big effort to ensure the safety of New Year’s Eve celebrants in Times Square, he said, it “doesn’t seem to have the same concern for the one million students in the public school system.”

DOE spokeswoman Miranda Barbot said “detailed protocols” guide schools in the event of an emergency.

Lockdowns and shelter-ins are more common today than parents may remember from their own school days.

Davids, 44, doesn’t remember any such incidents during her days as a student at John Jay HS in Park Slope. She attributed the number of lockdowns to “the times we are living in.”

Everytown For Gun Safety, a gun control group, cites 271 US school shootings reported since 2013.

“Parents and other adults tend to get more freaked out by lockdowns than today’s students,” said Trump. “Like the fire drill, lockdowns have become part of the culture of school.”