49ers Cardinals Football

San Francisco 49ers defensive end Nick Bosa, left, sacks Arizona Cardinals quarterback Colt McCoy during the first half of an NFL football game Monday, Nov. 21, 2022, in Mexico City. (AP Photo/Fernando Llano)

SANTA CLARA, Calif. (AP) — The San Francisco 49ers defense got humbled a bit by Patrick Mahomes and the Kansas City Chiefs last month.

Since then, it has been back to the unit's usual dominance — especially in the second half.

The Niners have put together three straight defensive masterpieces to move into a tie for first place in the NFC West, pitching second-half shutouts against the Rams, Chargers and Cardinals.

"Guys have done a great job in the second half of being where they're supposed to be, making the plays that they're supposed to make," defensive coordinator DeMeco Ryans said Wednesday. "They're doing an outstanding job. I can't give those guys enough credit. If you want to win games, you have to close it out in the second half. They've done that for three weeks."

It's a far cry from what happened back in Week 7 against Kansas City, when the Chiefs scored TDs on the first four drives of the second half in a 44-23 win at Levi's Stadium.

But San Francisco (6-4) has gotten healthier since then and taken advantage of an easier slate of opponents.

The Niners surrendered a few big plays in the first halves of those three wins, but Ryans' unit has made the necessary changes to make sure that doesn't happen in the second half.

"He's amazing," defensive end Nick Bosa said about Ryans. "He knows when to make the right calls. I don't think he'll be here much longer, unfortunately, if he wants a head job somewhere. But three second-half shutouts in a row is winning football, and if we can keep that up, then with our offense we're going to be a tough team to beat."

This marks just the third time since at least 1991 that the Niners have shut out three straight opponents in the second half, doing it on the way to the Super Bowl in 2019 and 1991.

They have allowed just 242 yards after halftime in those games for an average of only 3.1 yards per play.

"That's just a product of execution," linebacker Fred Warner said. "The more energy being brought because you're making more plays and the whole team feeds off of that. So we just got to continue to be hard on ourselves."

The 49ers defense has playmakers on all three levels with Bosa spearheading the pass rush with 10 1/2 sacks, Warner and Dre Greenlaw patrolling the middle of the field at linebacker and a much-improved secondary with cornerback Charvarius Ward, emerging big-play safety Talanoa Hufanga and the return of the reliable Jimmie Ward from injury.

Now Ryans wants to see his defense put it all together for a full game and avoid the breakdowns that have led to a few big plays in the first half the last three games.

"We're thinking about just playing clean football," he said. "Really the emphasis is how do we do this in the first half. Can we not give up the bonehead play in the first half to even allow teams to be in position to have to shut them out in the second half The mindset is can we go out and play our best for the entire game."

NOTES: DT Arik Armstead (foot, ankle) remained out of practice and LT Trent Williams got a rest day. ... DE Samson Ebukam (quadriceps, Achilles) was limited in practice. ... Coach Kyle Shanahan said it was possible DT Javon Kinlaw (knee) could return from IR during this three-game homestand.