New York Jets head coach Robert Saleh looks on during...

New York Jets head coach Robert Saleh looks on during an NFL football game against the Denver Broncos, Sept. 29, 2024, in East Rutherford, N.J. Credit: AP/Adam Hunger

SANTA CLARA, Calif. — The San Francisco 49ers began their search for a new defensive coordinator Thursday by interviewing Robert Saleh for a second stint at the job and Detroit Lions assistant Deshea Townsend.

The Niners fired Nick Sorensen earlier this week after just one season in the role and are seeking their fourth defensive coordinator in the past four seasons.

DeMeco Ryans left after his second season in the role in 2022 to become head coach for the Houston Texans and Steve Wilks was fired after the 2023 season when San Francisco went to the Super Bowl.

The 49ers regressed this season under Sorensen as the injury-filled unit struggled to create turnovers, stop the run and create consistent pressure on the quarterback.

San Francisco ranked 29th in the league in scoring defense, allowing 25.6 points per game, and was tied for the seventh-fewest takeaways with 17. The Niners had just two takeaways over the final nine games and ended the season allowing at least 40 points in back-to-back games for the first time since 2015.

San Francisco has run a similar system for the past several years starting during Saleh's tenure from 2017-20, but coach Kyle Shanahan said he wants a coordinator who can better adapt to the personnel and is open to changing scheme.

Saleh helped build a defense that was one of the league's most dominant units the previous few years. He was Shanahan's first defensive coordinator in 2017 and struggled the first two seasons.

This is a 2024 photo of Deshea Townsend of the...

This is a 2024 photo of Deshea Townsend of the Detroit Lions NFL football team. This image reflects the Detroit Lions active roster as of June 3, 2024 when this image was taken. Credit: AP

But after the team drafted defensive end Nick Bosa in 2019 and implemented the “wide nine” scheme that featured edge rushers lining up wide and focusing on getting up field, the defense took off.

San Francisco went to the Super Bowl in the 2019 season and still had a strong season the following season when Bosa missed almost the entire year with a knee injury, leading to Saleh getting the head coaching job with the New York Jets.

Saleh was fired midway through this past season, but the Jets had a strong defense under his tenure. Saleh is also in the mix for possible head coaching jobs.

Townsend is in his first season as passing game coordinator and defensive backs coach in Detroit after spending the previous two seasons in that role for Jacksonville. Townsend has also worked as an assistant for Arizona, Tennessee, the New York Giants and Chicago following a 13-year playing career.

This is a 2024 photo of Deshea Townsend of the...

This is a 2024 photo of Deshea Townsend of the Detroit Lions NFL football team. This image reflects the Detroit Lions active roster as of June 3, 2024 when this image was taken. Credit: AP

Townsend had 21 career interceptions and was part of two Super Bowl-winning defenses with Pittsburgh in the 2005 and 2008 seasons.

The Lions led the NFL this season in allowing an 82.0 passer rating, down from the 91.5 in 2023.

Townsend was only allowed to interview virtually under NFL rules, which forbid coaches currently under contract with any team from interviewing in person until Jan. 20.

The interviews satisfy the requirements to the Rooney Rule, which require teams to interview at least two diverse candidates from outside the organization before making a coordinator hire.