City school officials are finally moving to restrict educators from inappropriately contacting their students via Facebook, Twitter and other social-media sites.

“We prefer they not interact — Facebook is open, and as a result of that, it leaves you open for interpretation and communication that may not be appropriate,” Schools Chancellor Dennis Walcott said yesterday.

The schools chief said the move is necessary because of many hazards where teachers can see private pictures of students and have access to a host of personal information.

“We know it’s a different age now than when I was in school, but at the same time, you as a teacher, you as a staff member, don’t want to leave yourself in a position where you can be in a compromised position with a student,” Walcott said.

While specifics weren’t revealed, the Department of Education’s work toward its first social-media policy comes amid seven arrests since February of school staffers for allegedly sexually abusing students.

DOE officials said the policy — set for release this spring — has been in development for months.

None of the recent allegations has involved the use of social media, according to officials.

But The Post has reported on cases where teachers used online communication in an effort to cross the line.

In one case, a Bronx high school teacher wrote inappropriate comments such as “this is sexy” beneath photos of female students he had “friended” on Facebook, before giving one gifts and asking her out.

And a Manhattan high school substitute wrote sexually laced comments to female students on Facebook — including telling one girl that he had tried to visit her in her Saturday class.

Both instructors, who were investigated in 2010, have since been booted.

The Los Angeles school district last month created its first social-media policy, urging teachers to interact with students on Facebook using only professional accounts that are kept separate from their personal ones.

“The same type of things that regulated e-mail before now have to regulate Facebook,” said the district’s social-media director, Stephanie Abrams.