NEW YORK — Mets second baseman Neil Walker will miss the rest of the season because of surgery for a herniated disk in his back, the latest in a series of severe injuries to strike the defending NL champions this year.

Walker made the announcement Thursday before the wild-card contenders played Miami.

“It just wasn’t getting better,” he said.

Had he continued to play, he estimated he would’ve been at “60 percent.” Or, as New York manager Terry Collins said Walker told him Wednesday night, “Not sure I can help.”

Minus Walker, the Mets will use Wilmer Flores and Kelly Johnson at second base. A recent push moved the Mets within 1 1/2 games of St. Louis for the second NL wild-card spot.

Walker has been a steady presence in his first season with the Mets, tying a career high with 23 home runs while batting .282 with 55 RBIs. Collins often has praised Walker for his production on the field and his leadership qualities in the clubhouse.

“Walk gave it his best effort,” Collins said, later adding, “Neil’s played absolutely great.”

The switch-hitter, who turns 31 this month, said the success rate for his type of surgery is “very high” and that the recovery period is three months. He said he expects to be able to continue his career at a fine level after the procedure.

No date has yet been set for the surgery.

Traded over from Pittsburgh in the offseason, Walker proved to be more than a capable replacement for playoff star Daniel Murphy, who became a free agent and has produced MVP-caliber numbers for NL East-leading Washington.

Walker joined third baseman David Wright, first baseman Lucas Duda, ace Matt Harvey and other Mets to be struck by significant injuries this year. Slugger Yoenis Cespedes, shortstop Asdrubal Cabrera and several of the club’s young pitchers also have missed time.

Though the Mets have adjusted to a shifting roster, Walker’s absence leaves “a big piece missing,” Collins said.

Walker had been trying to rest his ailing back lately, playing a few games and then taking time off. He had played just four times in the last two weeks, which included a brief stay on the paternity list.

Even so, Walker said doctors told him his condition wasn’t improving that way.

Walker said he felt OK to swing, but that it was the other things — diving for balls, sliding, trying to break up double plays — that had become extremely difficult. He said the back problem has left him unable to have feeling in his toe.

No one thing caused him the trouble, he said. Instead, the cause was the “culmination of the wear and tear of baseball.”

“I’ve played through this for four years,” he said.

Walker is eligible for free agency after this season ends. He said that aspect of his future didn’t enter into his decision, saying it was “the farthest thing from my mind.”

Said Collins: “I sure hope we get the opportunity to get him back.”