SANTA CLARA, Calif. — After a three-week stretch that offered signs of substantial improvement, San Francisco 49ers cornerback Ahkello Witherspoon is expected to miss at least a month with a right foot sprain.

Niners coach Kyle Shanahan said Monday afternoon that Witherspoon’s injury was serious enough that it will keep him out for the extended period, a disappointing blow for a Niners secondary that has been much-improved from last season through the first three weeks of 2019.

“That’s the challenges of this sport,” Shanahan said. “I felt really bad for him because he’s been playing at a high level. He’s been covering very well and he’s been playing very physical, too. I thought yesterday was probably the most physical game I’ve seen him have. He was making tackles, throwing his body around and he’s been covering very well all year. So, it is unfortunate for him but these setbacks do happen in this league. It’s part of football and he’ll work to get back and when he comes back we expect him to be right where he was when he left off.”

Witherspoon departed Sunday’s 24-20 win against the Pittsburgh Steelers late in the third quarter when a cart picked him up on the 49ers’ sideline and took him to the locker room. After the game, Witherspoon expressed confidence that he would be able to return after the Niners’ Week 4 bye, telling ESPN “I’ll be good” in the locker room even as he was wearing a walking boot on the injured foot.

Further tests Monday apparently revealed a more serious sprain, which could cost Witherspoon upcoming games against the Browns, Rams, Redskins, Panthers and possibly the Cardinals if the injury takes a little more than a month to recover from.

In the meantime, the 49ers now must explore their options to replace Witherspoon, who through three weeks had yielded a passer rating of just 9.8 when targeted, according to Pro Football Focus.

One option could be to explore the trade market, where a deal for Jacksonville cornerback Jalen Ramsey remains a long shot but will undoubtedly regain traction as a topic among the 49ers fanbase with Witherspoon out.

Asked about the potential for a trade in general, Shanahan said it’s something to consider but there is a lot that factors into the equation.

“We always look at the trade market,” Shanahan said. “And we’ll continue to but it’s got to make sense for us.

“How much does it help the team right now and how much does it help the organization going forward? You always think of now but you also always think of years in advance too and how that affects salary caps, draft picks, things like that, the risk-reward on everything.”

More likely, the 49ers will turn to in house options for the time being. Those choices include Emmanuel Moseley, Jason Verrett, D.J. Reed Jr. and, potentially, safety Jimmie Ward.

In Sunday’s win, Verrett got the first opportunity to step in for Witherspoon. It was Verrett’s first regular season snaps since Sept. 11, 2017 as injuries have derailed a once-promising career. Verrett’s rust showed quickly as he was flagged for a 32-yard pass interference penalty then gave up a 39-yard touchdown pass on consecutive plays.

Moseley, a 2018 undrafted rookie out of Tennessee who made the roster on the strength of his special teams’ ability, replaced Verrett on the next Steelers possession and finished the game there.

According to Shanahan, Moseley will be first in line to replace Witherspoon moving forward, though he’s expecting to have competition during the extra practices the Niners will get because of their Week 4 bye.

San Francisco is planning to practice Tuesday and then next Monday and Tuesday before resuming a normal work week in advance of the Oct. 7 game against Cleveland on Monday Night Football.

“It’ll be all about practice,” Shanahan said. “We have a number of guys who are candidates for it. E-Man would be the lead guy right now with how he finished that game and came in and what he’s done for us this whole year. But we’ll give all the other guys a chance too with these practices we have before Cleveland.”

In better 49ers injury news, Shanahan again expressed hope that receiver Jalen Hurd (stress reaction in his back) and running back Tevin Coleman (sprained ankle) would be able to return after the bye.