Garcon has been sidelined since San Francisco's 34-3 win against the Oakland Raiders on Nov. 1.
"We waited on Pierre for a bit," Shanahan said. "It was going very positive for a while. That's why I felt real good about it. But we came back from that bye week, and it had gotten worse.
"We tried our hardest last week. He went out and went full-go Wednesday. It swelled up on him, caused him a lot of pain, and after having that same thing through almost most of the year, especially it was the week before the Green Bay game that it really started coming, it was just lingering too long where P knew he had to get something done. So we had to shut him down now."
Garcon recorded 24 receptions for 286 yards and a touchdown in eight games this season for the 49ers (3-10), who host the Seattle Seahawks (8-5) on Sunday (4:05 p.m.).
The 32-year-old Garcon has made 628 catches for 7,854 yards for 38 touchdowns in 148 career games with the Indianapolis Colts, Washington Redskins and 49ers. Garcon was selected by the Colts in the sixth round of the 2008 NFL Draft.
Garcon, who is listed at 6-foot and 211 pounds, signed a five-year, $47.5 million deal with the 49ers on March 9, 2017.