Medford, who played at Italia 90, is determined to travel to Japan and South Korea.
He underwent surgery to cure his problem but really requires another operation in April.
"As a doctor, I recommend that Medford has an operation and forgets the World Cup," said surgeon Jaime Ulloa.
Ulloa said Medford could face serious long-term damage if he did not have the second operation.
Medford scored the winning goal when Costa Rica beat Sweden to reach the last 16 at the 1990 World Cup in Italy.
Last year, he scored a late winner as Costa Rica became the first team to win a World Cup qualifier in Mexico's Azteca stadium, ending a 52-match unbeaten record.
Costa Rica will play in Group C of the World Cup's first phase along with China, Turkey and Brazil.