Background: Medication adherence is crucial for patients with mechanical heart valve replacement. Although families functioning is positively associated with medication adherence, little is known about the underlying mechanisms.Objective: To test whether family functioning affects medication adherence through illness perceptions and whether this mediating effect was moderated by medication literacy.Methods: 319 patients after mechanical heart valve replacement were included in this cross-sectional study from June 2021 to October 2021. Data regarding family functioning, illness perceptions, medication adherence, and medication literacy were collected through questionnaires. The moderated mediation model was examined by Hayes’s PROCESS macro, based on the bootstrapping method.Results: The results revealed illness perceptions partially mediated the association of family functioning on medication adherence [β = 0.08, 95% confidence intervals: (0.04, 0.12)], and this effect was stronger for patients with low medication literacy than those with high literacy [β = −0.36, 95% CI: (−0.50, −0.22)]. Furthermore, the relationship between family functioning and medication adherence was only significant in patients with low medication literacy [β= 0.36, 95% CI: (0.23, 0.50)].Conclusion: The mediating effect of illness perceptions between family functioning and medication adherence was moderated by medication literacy. Efforts to improve medication adherence by targeting at improving family functioning may be more effective when considering illness perceptions, especially for patients with limited medication literacy.