The former England striker had emerged as the frontrunner for the job - made available following the dismissal of Dave Jones last month - in recent days.
In a statement last night, Shearer said: "I can confirm that I was one of the candidates that the club spoke to about the vacant manager's position at Cardiff City. During these talks I was most impressed with the vision, ambition and determination of the owner Dato Chan Tien Ghee and the board.
"Unfortunately those talks were unsuccessful on this occasion. Cardiff City is a great club and I wish them every success next season."
Shearer's only managerial experience was at the helm of Newcastle for a run of eight games in 2009. He won only one and The Magpies were relegated to the Championship that season.