On 8 September 2013, Yáñez made his professional debut, starting in a 0–1 home loss against CD Mirandés.[3] Mainly a backup to Fernando Pacheco during the campaign, he appeared in four matches as his side suffered relegation.
After Pacheco's promotion to the main squad, Yáñez was an undisputed starter for the reserves in 2014–15, contributing with 30 appearances. On 5 August 2015 he was promoted to the first team by new manager Rafael Benítez,[4] and made his debut four days later, coming on as a late substitute for Kiko Casilla in a 0–0 friendly draw against Vålerenga Fotball.[5]
Yáñez was the third option behind Keylor Navas and Casilla when the team won the 2015–16 UEFA Champions League.[6] He did not make an appearance during the season when Madrid won the 2016–17 La Liga[7][8] and the 2016–17 UEFA Champions League.[9] With 21 total appearances on the substitute bench across two years, he only played one official match for Real Madrid on 30 November 2016, again as a late substitute for Casilla in the last 15 minutes of an eventual 6–1 win (13–2 aggregate) against Cultural Leonesa in the Round of 32 of Copa del Rey.
Getafe
On 17 August 2017, Yáñez signed a four-year deal with Getafe CF, being immediately loaned to Cádiz CF for one year.[10] He made only six appearances during his time in Andalusia, all in the Copa del Rey.[11]
Yáñez finally made his debut for Getafe on 17 December 2020 in a 2–1 win at CD Anaitasuna in the first round of the cup.[13] Three days later he made his La Liga bow in a 2–0 win at former club Cádiz, to finally play in the top flight at the age of 26.[14] After ten consecutive games in all competitions – including once David Soria had returned from injury – he lost his place to him in February.[15][16]
On 15 July 2022, Yáñez terminated his contract with Getafe.[17]
Málaga
On 15 July 2022, hours after leaving Getafe, Yáñez signed a three-year deal with Málaga CF in the second division.[18] Second-choice to Manolo Reina, he made his debut on 3 November in the 14th game of the season, a 2–1 loss at FC Cartagena.[19] On 30 June of the following year, after the club's relegation, he left after activating an exit clause on his contract.[20]