There’s plenty of love for the homeless at City Hall — just not outside Gracie Mansion.

A Post reporter who went undercover as a vagrant quickly got rousted near Mayor Bill de Blasio’s residence on Wednesday by a cop who told him there was no way Hizzoner would stand for it.

“You see that big house up there? That’s the mayor’s house,” the cop said.

“Here’s the thing: You try to panhandle in front of the mayor’s house, he’s going to have you moved.”

When asked if de Blasio would really do that, the cop answered, “Yeah, you’re going to be moved.”

“You’re in front of the mayor’s house. Think about it. How does it look, somebody panhandles in front of the mayor’s house? You see what I’m saying?”

Before the officer could make good, more cops showed up with a police wagon and three patrol cars — two with flashing lights.

After conferring with his fellow Finest, the first cop came back and changed his tune, saying it was OK for the fake bum to remain with a hand-lettered sign saying: “HELP THE HOMELESS.”

“You can panhandle here, all I’m trying to say is that you’re not gonna make money here because you don’t get a lot of people,” the cop said, despite a steady stream of passers-by.

Earlier, a different cop had told the Post reporter/vagrant to “Keep walking” as he paced back and forth in front of the entrance.

That officer also shooed him off a bench outside the entrance to Gracie — even though NYPD Commissioner Bill Bratton told a news conference Wednesday that the homeless “have every bit as much right … as you or I” to hang out in parks and sit on benches.

“You wanna go farther away. It’s a bad spot,” the cop said.

“It’s a secure location. Very sensitive.”

The mock derelict gave up his seat to a young woman, another Post reporter — and she got a big smile from a different cop who strolled by on patrol.

But when she left and the first reporter went back to the spot, the officer who had told him to move returned, asking: “Are you feeling sick or anything?”

You’re in front of the mayor’s house. Think about it. How does it look, somebody panhandles in front of the mayor’s house? You see what I’m saying? - An NYPD officer

“Do you want to go to a hospital or anything like that?”

“Why’d you come back? I thought I told you to sit over there,” the officer said.

The ersatz outcast also was awakened by the crackling sound of police radios carried by three cops who approached as he snoozed nearby.

“You can’t sleep on the sidewalk,” one said.

The interactions began about 45 minutes after the male reporter showed up at Gracie Mansion in Carl Schurz Park at East 88th Street and East End Avenue around 9:30 a.m. — and followed an incident in which a man in a tan suit and pink tie came out through the security gate to get a look at the fake bum just after 10 a.m.

Meanwhile, other New Yorkers were far more sympathetic, with one woman even giving the undercover reporter her $6.50 deli lunch when she saw him rummaging through a garbage can.

Gnanalatha Medagedara, a nanny, said she learned compassion as a Buddhist in Sri Lanka.

“He has no money and he’s hungry, right? So I give him. I’m so happy. I give my lunch, he will eat that. How happy is that?” she said.

Plumber Damian Misiur, 20, also objected to the massive police response to a single vagrant.

“Simply because he’s homeless, they have to jump on his case. He’s a person just like anybody else, he’s not hurting anyone,” he said.