When TV writer Mike Judge re-created a high-stakes startup pitch contest in his HBO series “Silicon Valley,” viewers criticized him for hiring mostly male extras to act as spectators at the industry event.

Those weren’t extras, he told them. That was footage from the actual audience of TechCrunch Disrupt. The signature green spotlights lit up mostly young, mostly white and almost entirely male faces watching the Startup Battlefield.

This year’s Disrupt in San Francisco, the flagship event for the AOL-owned technology news site, told a different story. Held in a warehouse on Pier 48, the 2016 edition attracted 4,000 participants across a broad spectrum of nationalities and ethnicities and more women. Its first panel of seven Battlefield judges included three women from a variety of ethnic backgrounds.

It’s a far cry from just a few years ago, when Disrupt made national news — and not for a startup landing millions in funding or a big deal getting announced. In 2013, a couple of tech bros pitched a photo-sharing app called Titstare that, well, you get it. Another contestant feigned masturbation on stage. TechCrunch’s editors apologized and promised to make changes.

“The incident in 2013 really made us wake up and say there are repercussions for not doing more,” said TechCrunch editor Sam O’Keefe, who runs the Battlefield program. “So that’s what we did.”

The restroom lines at Pier 48 looked like years past, with long queues at the men’s stalls and an inviting absence in front of the women’s bathroom. But otherwise, things looked very different.

Speakers included Google executive Diane Greene and robotics pioneer Melonee Wise. A panel discussion dove into startup opportunities in women’s health: Clue founder Ida Tin pitched a birth-control app that uses menstruation data. She was joined by Fertility IQ founder Deborah Anderson-Bialis and Naya Health founder Janica Alvarez, who described a smart breast pump.

Mamava, a Vermont startup which makes compact pods where nursing mothers can pump in privacy, set up a lactation booth at the conference. Not everyone got the message: BuzzFeed reported seeing a man in khakis using the booth to make a phone call Wednesday morning.

O’Keefe now runs TechCrunch Include, an effort to promote diversity at TechCrunch events and in the broader community. The group this year gave free tables in Startup Alley to nonprofits and hosted 50 minority students. TechCrunch also made a more conscious effort to have a more diverse group pitching onstage.

Trinity Ventures partner Anjula Acharia was on the first panel of judges for Startup Battlefield. The diversity of Disrupt judges impressed Acharia, she said.

“They’re not just talking the talk,” Acharia said. “They’re trying to make positive changes.”

However, funding is the real challenge for founders who are women and underrepresented minorities, she said. When Acharia agreed to meet Diishan Imira, founder of Oakland salon distribution company Mayvenn, he told her no other investor had agreed to meet him in the East Bay city. Despite these rebuffs, Imira persevered. Trinity, Andreessen Horowitz and other backers invested $10 million in the company.

Fetch Robotics CEO Wise agreed that funding diverse kinds of entrepreneurs remains the biggest issue. All the startups pitching at Disrupt hope to attract attention from the investors in attendance.

“The question is who gets funded,” Wise said. “None of these are going to get successful without funding.”

Wise said she experienced less bias in Silicon Valley than she did at home in Illinois. Silicon Valley, she said in her onstage interview, was the “Holy Land” for women in technology compared with the Midwest. She worries that the diversity conversation is dominated by gender, leaving out socioeconomics, ethnicity and sexual orientation. Ethnic minorities face a more strenuous uphill battle than women, she said.

Leslie Miley left his job as an engineering director at Twitter last fall and wrote about his concerns about the company’s approach to diversity. He now works at Slack, the workplace-collaboration software company, and spoke at Disrupt on Monday. Diversity in technology requires more than improving the numbers, he said.

“It’s hard to encourage people to stay in a place that is hostile to them,” Miley said.

Slack is now using techniques like blind testing, without names or educational backgrounds, to improve diversity among its workforce.

TechCrunch did not have demographic data available Tuesday but plans to release a report on the event later this year.

TechCrunch has not achieved all that O’Keefe wants it to in terms of inclusion, but it has taken a step forward, she said.

“That’s true in the tech community as a whole,” she said. “People are talking about this now. The industry as a whole has developed self-awareness, and it’s taken the first steps.”

Jessica Floum is a San Francisco Chronicle staff writer. Email: jfloum@sfchronicle.com. Twitter: @jfloum