Here is Part II of the 49ers’ 2018 season grades. Part I, which included each of the 49ers’ offensive position groups, ran Wednesday.

Defensive linemen: A-minus

They defended the run well. The 49ers ranked seventh best out of 32 teams in rushing yards per attempt allowed.

They also rushed the quarterback well at home, where their sack percentage was 10th best. They clearly have the talent, yet their sack percentage fell to 27th on the road.

But the entire defense played poorly away from home.

More on the road issues below.

Defensive tackle DeForest Buckner is one of the 10 best pass rushers in the NFL. He recorded 12 sacks and 20 hits. And defensive ends Ronald Blair and Cassius Marsh each recorded 5½ sacks and 14 QB hits — solid numbers for two young players who combined have started only seven games in their careers. Both play with high energy.

So does defensive tackle Solomon Thomas, the 49ers’ first-round pick in 2017. He just doesn’t make an impact. He recorded just one sack and six quarterback hits.

Linebackers: A-minus

Rookie middle linebacker Fred Warner made 124 tackles — 12th most in the league. He never played middle linebacker before this season.

Second-year outside linebacker Reuben Foster was a bust, and the 49ers released him after he allegedly hit his girlfriend during a road trip at the team hotel in Tampa, Florida.

But the 49ers may have found an upgrade for Foster: Elijah Lee. He started five games this season and recorded 47 tackles during those starts — 9.4 tackles per game. If he maintains that average for a full season, he will make 150 tackles in 2019.

Lee and Warner form an intriguing duo, but they must force more turnovers in the future. Each forced just one in 2018.

Defensive backs: C-minus

Left cornerback Richard Sherman played well, considering he came off a torn Achilles tendon. Opposing quarterbacks rarely threw at him.

Instead, they threw lots of passes at right cornerback Ahkello Witherspoon, who broke up only four throws and intercepted zero passes in 14 games. He also gave up six touchdown catches and committed 10 penalties before he injured his knee and missed the final two weeks.

Rookie Tarvarius Moore replaced Witherspoon and broke up two passes and forced one fumble in two starts. Moore may beat out Witherspoon for the starting job next season.

Strong safety Jaquiski Tartt injured his shoulder Week 2, and that injury hurt his performance and caused him to miss eight games.

When healthy, he still is an important member of the defense.

Free safety Adrian Colbert broke up just one pass in seven games before an ankle injury ended his season. The 49ers probably will look to add a new starting free safety for 2019.

Special teams: C

Here’s the good:

Robbie Gould was the most accurate kicker in the league. He made 33 of 34 field-goal attempts. And Richie James is a dangerous kickoff returner. He is one of only four players who returned a kickoff for a touchdown in 2018.

Punter Bradley Pinion ranked 28th in average punt distance. And punt returners Dante Pettis and Richie James each fumbled two punts. As a team, the 49ers averaged only 5.8 yards per punt return — fourth fewest in the league.

Coaches: D

Defensive coordinator Robert Saleh installed a scheme that stops the run and limits long passes. The 49ers defense gave up the 10th-fewest pass completions of 20 yards or more.

But Saleh failed to adjust his scheme in the red zone. The 49ers ranked 26th in red-zone defense for the second season in a row, partly because he continued calling the soft zone coverages he favors in the middle of the field. Opposing receivers often made wide-open touchdown catches in the red zone against the 49ers.

Saleh also failed to build a scheme that creates interceptions and pass breakups. The 49ers set an NFL record for fewest interceptions in a season — they recorded just two. And they broke up only 39 passes — fewest in the league. The 49ers players weren’t even close to the ball most of the time. As a result, they gave up 35 touchdown passes, second most in the league, and an average opposing quarterback rating of 105.4 — second highest in the NFL.

Saleh’s defense is ultra-conservative. He concedes short passes and asks his players to make tackles rather than aggressive breaks on passes trying for interceptions. He needs to tweak his scheme to create more turnovers.

Kyle Shanahan as the offensive coordinator did a good job creating explosive plays. His offense ranked fifth in pass completions of 20 yards or more and eighth in runs of 20 yards or more.

But his quarterbacks threw 20 interceptions — third most in the NFL.

And Shanahan the OC struggled scheming situational offense. In the red zone, the 49ers offense ranked dead last, scoring touchdowns only 41.2 percent of the time. And in the fourth quarter, the offense also ranked dead last, averaging just 3.8 points.

But the 49ers’ biggest issues aren’t scheme or talent. Their issues are durability and leadership.

And that reflects badly on Shanahan the head coach. He favors small, fast players. It’s a good idea, but his small players can’t hold up for 17 regular-season weeks plus the preseason, training camp, minicamp and OTAs. That’s one reason the 49ers have had so many injuries the past two seasons.

And Shanahan the HC struggles preparing his players for road games. At home, the 49ers’ record was 4-4. But on the road, they were the only team in the NFL that lost every game. And they lost by an average of 11 points. They were unprepared — especially the defense, which gave up 32.5 points per game away from Levi’s Stadium. Considering their talent level and how well they played at home, that’s way too many points.

A head coach is responsible for preparing the entire team, and handling the mundane managerial details of a road trip, such as departure dates, arrival times, meal schedules, menus, meeting schedules, practice times — everything. He needs to see the big picture, can’t merely focus on offensive plans even if they are brilliant.

If the 49ers play an East Coast game that starts at 10 a.m. Pacific time, maybe they should practice all week at 10 a.m. to adjust their body clocks. They don’t do this.

Preparing a football team to play on the road is difficult. Jim Harbaugh was the only 49ers head coach since 2002 to have a winning record on the road — he was 22-11. The rest of the 49ers’ head coaches, including Shanahan, have been 19-77 on the road.

Shanahan should consider changing the 49ers’ road routine. Better results won’t just happen. They didn’t happen for Dennis Erickson, Mike Nolan, Mike Singletary, Jim Tomsula or Chip Kelly. Shanahan has to make the results happen. Maybe he should call Harbaugh.

The overarching theme of the 49ers’ just-completed season is that this team is more talented, especially on defense, than people give it credit for. The coaching may be holding back the players.