The NYPD isn’t only cleaning up homeless encampments ahead of Pope Francis’ visit — it’s cleaning them up for the commissioner, too, The Post has learned.

“You’re not going to see them. You’ve got the commissioner here,” a cop said as he stood outside St. Patrick’s Cathedral where Bill Bratton did a security sweep Wednesday.

In the past, the officer said, a precinct commander went berserk on his police pal after the NYPD commissioner was greeted by a derelict.

“He called my buddy and tore into him because there was a bum on a corner,” the cop told a reporter. “He said, ‘Why am I seeing this homeless guy here?’”