Yarran, who was recruited by the Dockers at the end of 2015 after a standout season in the WAFL last year, played six senior games this season.
The 27-year-old has been on personal leave from the club this month after being charged with unlawful wounding. That charge followed a charge of aggravated common assault for which he appeared in court earlier this month.
“We have met several times during the past two weeks and again today to discuss Shane’s welfare and the best way for him to cope with the personal and off-field matters he is facing,” Dockers chief executive Steve Rosich said in a statement.
“A focus of those discussions was to establish a course of action that would best cater for Shane’s welfare in the long-term.
“It was agreed two weeks ago that allowing Shane to take a period of personal leave would allow sufficient time for him to focus on resolving his personal and off-field matters.
“However, upon further reflection by Shane and his management it was agreed that a longer-term solution was required, which would allow him to focus solely on his personal and off-field matters – without the pressure and demands of being an AFL footballer.
“It was agreed by all parties today that it was in Shane’s best interests that he retire from AFL football immediately.
“It was a difficult decision for Shane to reach, but both he and his management believe that focusing on his personal and off-field matters at this time needs to take priority over his football career.”