SAN FRANCISCO — Most days he is at work at AT&T Park here, Giants pitcher Madison Bumgarner can be seen with a clump of smokeless tobacco lodged in his lower lip. Bumgarner, a World Series hero and the face of the team, grew up in small-town North Carolina, where, he said, nearly all men dipped. He has been doing it since he was in fifth grade.

“Pretty much all the time,” he said.

Next year, though, Bumgarner will have to break the habit, at least at his home stadium. Signaling a profound shift in the culture of baseball, Mayor Edwin M. Lee of San Francisco signed an ordinance in May that banned smokeless tobacco from all public athletic fields in the city, including AT&T Park, starting on Jan. 1, 2016.

The move was pushed by the Campaign for Tobacco-Free Kids, a nonprofit group that approached San Francisco lawmakers as the first step in a plan to eventually rid Major League Baseball of smokeless tobacco. Matthew Myers, the president of the organization, said he expected at least six more cities with major league teams to pass similar legislation by the end of the year. A similar motion has been proposed by a Los Angeles city councilman. Myers plans to approach more cities until the entire league is accounted for.

“It will turn into an inevitability,” Myers said in a phone interview. “This is going to happen. The only question is, will it happen in enough cities so that baseball is tobacco-free by next year? Or will it take one more year?”