New York City on Wednesday moved to cut all ties to scandal-scarred Wells Fargo — but the bank still might be getting $1.3 million a year from the city.

Eight months after Wells’ phony-account scandal exploded — and four months after the city’s Finance Department signed a new deal with the bank — Mayor de Blasio and Comptroller Scott Stringer announced the Big Apple was cutting certain ties to the bank.

The sham-account scandal led to millions of dollars in federal and state fines, the ouster of the bank chief executive, multiple class-action lawsuits and hundreds of employees getting the ax.

“We need to send a message to this bank and the broader industry that ethics matter,” de Blasio and Stringer said in the statement.

The moves against Wells include a prohibition against the bank selling city municipal bonds, which are used to fund day-to-day operations.

Also nixed: banking services, administration of a “lock box” account that has about $227 million collected from taxes and fees, and service as a trustee for the New York City Retiree Health Benefits Trust, to the tune of about $2.6 billion.

But left off the list was the $1.3 million credit card processing contract the Finance Department re-signed with the bank in January.

At a hearing held so opponents of the bank could voice their displeasure with the extension, not a single city official showed up, The Post exclusively reported at the time.

Multiple messages left with the Finance Department, which is under de Blasio’s control, went unanswered. A spokesman for Stringer’s office declined to comment.

The NYC-Wells Fargo divorce won’t take full effect immediately. The city is stuck with Wells Fargo to collect taxes and fees until Dec. 31, 2020, when the contract expires.

New York isn’t the first city to sever ties with the bank. San Francisco and Chicago severed contracts with Wells Fargo last year. California and Illinois also followed suit.

When making the announcement, neither Stringer nor de Blasio explained why it took so long for the city to act.

As for Wells Fargo, the bank, in a statement, said it “appreciates the continuing dialogue with New York City and deeply values our relationship with the City.”

Thousands of employees at the San Francisco-based institution were caught last year creating 2 million unauthorized bank and credit card accounts to make sales targets.

“What happened at Wells Fargo was a fraud — and there should be consequences,” Stringer said in the joint statement with de Blasio.

The mayor and comptroller said they’ll have the New York City Banking Commission vote “to prevent agencies from entering into new banking services or related contracts with Wells Fargo, as well as bar agencies from renewing or extending existing contracts on expiration,” according to the statement.

De Blasio and Stringer also cited Wells Fargo’s “needs improvement” assessment from the Federal Community Reinvestment Act’s (CRA) rating system.

The federal legislation encourages banks to invest in low- and moderate-income communities.