Yankees starting pitcher Jameson Taillon walks to the dugout after...

Yankees starting pitcher Jameson Taillon walks to the dugout after being taken out of the game during the fifth inning against the Mariners in an MLB game at Yankee Stadium on Aug. 2. Credit: Kathleen Malone-Van Dyke

BOSTON — Myriad issues have contributed to what has been the Yankees’ worst stretch of baseball this season.

The offense hasn’t been as consistent as it was the first three-plus months of the season. The defense hasn’t been nearly as crisp. Nor has the baserunning.

But the biggest factor in the Yankees losing seven of their last eight games and taking a 7-13 post-All-Star break record into Friday night’s game against the Red Sox isn’t up for debate.

A pitching staff that spent the first part of the season ranked among the best in the sport — both starters and relievers — hasn’t approached that level of production.

Pretty much as long as professional baseball has been played, it has been said of pitching that “you can never have enough” of it. The Yankees can relate.

In the 20-game post-All-Star stretch, the Yankees’ pitching staff ranks 24th in the majors in ERA at 4.36. Compare that with the 3.08 ERA the club produced during the season’s first half.

The Yankees went into the trade deadline needing to bolster both the bullpen and rotation. They accomplished both goals, adding Lou Trivino and Scott Effross to the bullpen and Frankie Montas to the rotation.

But the latter group, already staggered by the lat injury that will keep Luis Severino out until at least mid-September and the inconsistency of Jameson Taillon, took a hit when it came to depth with the trade of Jordan Montgomery to the Cardinals.

That made Domingo German the fifth starter — he faced the Red Sox on Friday night — and required the Yankees to send Clarke Schmidt to the minors to get stretched out. Schmidt had proved himself to be a capable reliever when given chances in the big leagues this season, posting a 2.40 ERA in 16 games.

“Definitely, especially taking Monty off our team, that knocks into our depth a little bit,” Aaron Boone said after the Aug. 2 trade deadline. “But we were able to add Frankie Montas, which is pretty good. Clarke’s going down to try to stretch out a little bit to give us some more depth. We feel good about where Sevy’s going to be eventually. We’re definitely a little thinner based on [the Montgomery trade], but hopefully if we remain healthy, we feel like we’re going to be in a really good spot heading down the stretch and what we hope is into the playoffs and beyond.”

Boone hopes things shake out similarly in his bullpen. Though the group can’t quite be described as a mess, it also can’t be described as anything close to the dominant unit it was for much of this season.

The season-ending injury to Chad Green in May hurt, but the Yankees were able to get past that with little problem, mostly because of the emergence of Michael King. But they lost King for the season in late July, and that’s been a blow they haven’t shown they could absorb. Boone has been searching since then for an arm he trusts as much for the high-leverage situations King excelled in.

Clay Holmes has experienced some rough times of late, and the All-Star allowed at least one run in three of his last four outings going into Friday. Jonathan Loaisiga continues to search for the magic that made him one of the game’s top relievers in 2021. Wandy Peralta and Lucas Luetge have had a few more hiccups in recent weeks than in the early part of the season. Albert Abreu had been scored upon in three of his last four outings entering Friday.

Ron Marinaccio also got caught up in a numbers game. He had allowed one run and four hits in 22 2⁄3 innings in his last 19 games but was demoted to Triple-A Scranton/Wilkes-Barre to open a roster spot for Montas.

“We’ve got to get a couple of guys going,” Boone said of the bullpen earlier in the week. “But I absolutely feel [the bullpen] is in a good spot, especially when we’re set up.”

The Yankees entered Friday night having fallen a half-game behind the Astros for the best record in the American League. They had gone 10-18 in their last 28 and 22-25 in their last 47.

More Yankees headlines