Before St. Paul’s Presbyterian Church closed for good in December, its Sunday services were often lonely affairs.

One week there would be six worshipers, the next week seven. On Dec. 13, when the white wooden building at 43rd Avenue and Judah Street in the Sunset District held its final farewell service, just 20 congregants showed up to bid the church adieu, filling only the first few pews in the spacious sanctuary.

But the church’s next chapter could attract a great deal more attention than its swan song as a place of worship. That’s because the property is being considered as a future affordable-housing site — one of dozens of struggling churches around the city that could help address San Francisco’s housing crisis.

Supervisor Gordon Mar, who represents the neighborhood, says his district is home to more than 50 places of worship, many of which have dwindling congregations or are no longer active.

Mar says that taken together the churches represent the Sunset District’s best bet for affordable-housing development. Mar’s office has also been in talks for a project — likely about 50 units — at the defunct United Methodist Church at 1400 Judah St., which is home to the Wah Mei School.

Churches are “by far the largest set of privately owned sites in the Sunset that have development potential,” said Mar.

Mar said that what happens with the two Judah Street properties “will create a model for other churches.”

The push to develop church sites comes as Assemblywoman Buffy Wicks, D-Oakland, and state Sen. Scott Wiener, D-San Francisco, are working on separate legislation to make it easier to build affordable housing on church-owned properties. Wicks has introduced legislation that would exempt church properties from minimal parking requirements. Wiener is working on a bill that would allow affordable housing to be built on church properties not zoned for housing.

“There are a lot of churches and other places of worship that have excess land,” said Wiener. “Some of them have parking lots and they want to help homeless residents. But it can be extremely challenging for them. The land might not be zoned the right way. Or there might be really severe parking requirements.”

Landis Graden, a real estate consultant, said he has been hired by churches looking into the possibility of development in San Jose, Berkeley, Hayward, Vallejo, Richmond, Oakland, San Francisco, Campbell, Rohnert Park and other cities.

“We are working with 40 to 50 churches in the Bay Area,” he said.

Some housing projects on church property are already far along. In the Tenderloin, the Fifth Church of Christ Scientist won approval in 2018 at 450 O’Farrell St. to build 176 apartments, retail space and new offices by demolishing an old church on the site. Still, the project has not yet broken ground.

The Rev. Theresa Cho, a Presbyterian minister who leads the congregation at St. John’s Presbyterian Church on Lake Street, is looking at how the church might use its real estate to help solve the housing crisis. There are 22 Presbyterian churches in San Francisco alone, several of which have fading congregations. The same could be said for other denominations.

“For a city that is not very religious, we really are saturated with faith-based communities,” she said.

Cho said that she and other local religious leaders are looking at creating a community land trust for church properties to ensure they’re used for nonprofit housing.

“It’s all seeds right now, all dreams,” said Cho. “But it’s dreams that have legs, that aren’t just pipe dreams.”

David Garcia, policy director for the Terner Center for Housing Innovation at UC Berkeley, said he is working on a statewide inventory of church-owned potential development sites.

“We are looking at what is the acreage of land that is zoned for religious uses and trying to figure out how much is developable,” he said.

Graden, the real estate consultant, said churches tend to be inexperienced about development, and he wants to make sure the congregations don’t get taken advantage of. Many churches are cash-strapped and could benefit financially by selling air rights or executing a ground lease.

“Too often the churches get the short end of the stick,” he said. “They need to understand their development options internally before they talk to anyone.”

Peter Cohen, co-director of the Council of Community Housing Organizations, said that churches in San Francisco looking to build affordable housing will benefit from Proposition E, which rezoned large lots and public sites to allow for 100% affordable housing.

That will give neighborhood opponents fewer opportunities to block housing, which is what happened in 2018 when residents helped kill a senior project at the Forest Hill Christian Church.

“(Churches) have been looking into this for years and nothing has happened,” said Cohen. “This is not what churches do. They are not in the business of building stuff. Every congregation is starting at zero.”

But he said he is hopeful that the churches can help spread affordable housing into neighborhoods, like the Sunset District, which has not produced housing in decades, affordable or market rate.

For now St. Paul’s Church is eerily quiet. Posters advertise services and events from before the church closed. Outside, neighbors work in the church’s community gardens. Cho said the church’s desire to house poor people there is guided by a passage in the Gospel of Matthew, which instructs folks to “act boldly and compassionately to serve people who are hungry, oppressed, imprisoned or poor.”

“The scripture is real concrete,” said Cho. “What are you to do as a church? You are to feed the hungry. You are to clothe the naked. Whatever is within that scope is within our mission. Affordable housing fits under that.”

J.K. Dineen is a San Francisco Chronicle staff writer. Email: jdineen@sfchronicle.com Twitter: @sfjkdineen