Aaron Judge of the Yankees strikes out during the fifth inning against...

Aaron Judge of the Yankees strikes out during the fifth inning against the Astros at Yankee Stadium on Thursday. Credit: Jim McIsaac

Aaron Judge had to sit before he can hit.

Judge was held out of the Yankees’ starting lineup against the Astros on Friday night as Aaron Boone tries to find ways to manage the lingering pain in his slugger’s right big toe. Judge had played in six of the Yankees’ seven games after returning July 28. With a day game Saturday, he had to sit out at least one of the two days, Boone said.

With the Astros leading 7-2, runners on first and second and one out in the seventh inning Friday, Judge pinch hit for Kyle Higashioka and struck out on three pitches against Hector Neris.

“He’s able to do all the things he needs to do in the batter’s box,” Boone said. “He’s not getting around the bases as well as he normally would, obviously, and for the most part, he’s stayed away from the field a little bit by design because he’s not moving as well .  .  . We’ve just got to make sure we take care of him and build him up.”

The Yankees played Judge in rightfield only once in his first six games back, choosing to protect him in the DH role. He hit .278 with a home run and was walked seven times in 25 plate appearances.

The team, meanwhile, languished before he came back from the torn ligament in his toe, going 19-23 without him. In the 54 games Judge has missed this year (52 while on the injured list), the Yankees have gone 24-30 and batted .222.

The Yankees’ 7-3 loss to the Astros on Friday dropped them 3 1⁄2 games behind the Blue Jays for the third wild-card spot. They also are a game behind the Mariners and a half-game behind the Red Sox.

Boone said he is cognizant of the need to protect Judge now so he can play more later.

“I certainly don’t like not writing his name in the lineup,” he said. “I know he’s not physically all the way there by any means, so I know I’ve got to do it — even going into this 13-day stretch knowing there’s going to be a couple. So I’m pleased with how it’s going but also making sure that I do right by him that we get him built up so hopefully we have him for the bulk of this entire two months.”

Volpe maturing

Anthony Volpe went into Friday with a .400/.471/.667 slash line, a double, a home run, three RBIs and two walks in his previous five games. He drove in the go-ahead run against the Astros on Thursday.

Volpe, who has played in every game this season, went 0-for-4 Friday.

“I think he’s learned a ton, especially in the batter’s box,” Boone said. “He’s continued to make little adjustments. I think he has a way better understanding of what people are trying to do to him and what it takes to be successful at this level. I feel like he keeps moving the needle offensively.”

Loaisiga close

Jonathan Loaisiga, who had surgery to remove a bone spur in his elbow in May, will be in play to return Monday, Boone said. Loaisiga worked an inning-plus for Triple-A Scranton on Friday night, allowing four hits and two runs. He struck out three in his first inning but was lifted after giving up three hits to start the next inning.