Background & aim Some cultural scenarios in pregnancy and childbirth reinforce dysfunctional sexual beliefs that reverse changes in the couple's sexual life. The present study aimed to investigate the effect of education by sending text messages on modifying dysfunctional sexual beliefs in pregnant women. Methods & materials This study is a randomized clinical trial, and 82 eligible pregnant women referred to educational-medical centers to receive prenatal care were randomly assigned to intervention or control group. The intervention group received 24 text messages during eight weeks (three text messages per week), and the control group received only routine care. Data was collected through a demographic questionnaire, reproductive profile, Spinner's Dyadic Adjustment Scale (DAS), and dysfunctional sexual beliefs questionnaire. Both groups completed the questionnaires before and one week after the intervention. Independent t-test, paired t-test, and analysis of covariance was used to analyze the data. Results The findings revealed no statistically significant difference in the baseline Dyadic Adjustment mean scores of control (132.4 ± 11.01) and intervention (130.10 ± 10.66) groups. Paired t-test analysis showed that the mean score of dysfunctional sexual beliefs was significantly decreased from (29 ± 7.61) at baseline compared to one week after intervention (10.54 ± 6.97) ( p < 0.001). Analysis of covariance test to compare the scores of dysfunctional sexual beliefs in the intervention group (10.54 ± 6.97) and control group (26.80 ± 7.80) showed a statistically significant difference ( p < 0.01) with an effect size of 0.67. Conclusion This study showed that sending text messages to mobile phones of pregnant women has corrected their dysfunctional sexual beliefs. Therefore, this approach can be used in pregnancy care to promote women's sexual health. Trial registration Clinical trial registry: IRCT20161230031662N9 . Supplementary Information The online version contains supplementary material available at 10.1186/s12884-022-04773-1.