Retention in prevention of mother-to-child transmission (PMTCT) care is critical to prevent vertical HIV transmission and reduce morbidity and mortality of mother-infant pairs. We investigated whether weekly, interactive text-messaging improved 18-month postpartum retention in PMTCT care. This randomised, two-armed, parallel trial was conducted at six PMTCT clinics in western Kenya. Pregnant women with HIV at least 18 years of age with access to a mobile phone, able to text-message, or had somebody who could text on their behalf, were eligible. Participants were randomly assigned at a 1:1 ratio in block sizes of four to the intervention or control group. The intervention group received weekly text messages asking “How are you?” (“Mambo?” in Swahili) and were requested to respond within 48 h. Healthcare workers called women who indicated a problem or did not respond. The intervention was administered up to 24 months after delivery. Both groups received standard care. The primary outcome was retention in care at 18 months postpartum (i.e., clinic attendance 16–24 months after delivery based on data from patient files, patient registers and Kenya’s National AIDS and STI Control Programme database), which was analysed by intention-to-treat. Researchers and data collectors were masked to group assignment, while healthcare workers were not. Between June 25th, 2015, and July 5th, 2016, we randomly assigned 299 women to the intervention and 301 to standard care only. Follow-up concluded on July 26th, 2019. The proportion of women retained in PMTCT care at 18 months postpartum was not significantly different between the intervention (n = 210/299) and control groups (n = 207/301) (risk ratio 1.02, 95% confidence interval 0.92–1.14, p = 0.697). No adverse events related to the mobile phone intervention were reported. Weekly, interactive text-messaging was not associated with improved retention in PMTCT care at 18 months postpartum or linkage to care up to 30 months postpartum in this setting. (ISRCTN No. 98818734).