Ribery has established himself as one of the top players in world football since joining Bayern in 2007, helping them become the first German side to win the treble last season.
The France international - who is poised to play a key role in his country's upcoming FIFA World Cup play-off with Ukraine - was linked with Real and Barcelona before electing to move to Germany, rumours which resurfaced prior to him signing a new deal with the Bavarians in 2010.
And the 30-year-old has now admitted compatriot and Real legend Zidane had attempted to lure him to the Bernabeu.
"Barcelona and Madrid are very big teams. There was a moment when both teams were interested in me, and I liked both," Ribery told beIN Sport.
"But I had a moment in which I felt closer to Madrid than Barcelona. Zidane wanted me to go to Madrid and he tried all he could.
"I am not interested now because Bayern is my family."
Ribery is on a 23-man shortlist for the FIFA Ballon d'Or, and has expressed confidence over his chances of scooping the award.
"I feel good about it," he added.
"It is getting closer and closer. This has been one of my best years. I was lucky enough to win everything."
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.