The news came hours after the slumping Phillies learned second baseman Jean Segura would be sidelined for up to three months.
Harper has been the team's designated hitter after being diagnosed with a small UCL tear in his right elbow, which he hurt on a throw from right field in April.
The two-time MVP had a platelet-rich plasma injection in his injured right elbow on May 15 and then missed the next five games to recover.
He has been back in the lineup since, and was in manager Joe Girardi's original lineup for the final contest of the three-game series against the Giants. Harper, who last played in the field on April 16, is batting .303 with 10 homers and 32 RBI in 45 games.
Philadelphia entered Wednesday having lost five in a row and 12 of 16 to fall 12½ games behind the New York Mets in the NL East.
The Phillies will try to make up ground without Segura, one of their most reliable defensive players and consistent hitters, batting .275.
Segura fractured his right index finger while attempting to bunt in the seventh inning of Tuesday's 7-4 11-inning loss to the Giants. He will have surgery as early as Friday and miss 10 to 12 weeks.
"A big loss," Philadelphia manager Joe Girardi said prior to the game. "Jean is an everyday player that is productive for us. This is a difficult loss. I am not going to sugarcoat it. But teams go through this and you have to find a way to figure it out.
"It hurts. He's a good defender too. That's the thing. We lose that part of it too. He's a guy that can steal you bases. I mean, Jean can do a lot of things."