Medications are commonly used during pregnancy to manage pre-existing conditions and conditions that arise during pregnancy. However, not all medications are safe to use in pregnancy. This study utilized privacy-preserving record linkage (PPRL) to examine medications dispensed under the national Pharmaceutical Benefits Scheme (PBS) to pregnant women in Western Australia (WA) overall and by medication safety category. In this retrospective, cross-sectional, population-based study, state perinatal records (Midwives Notification Scheme) were linked with national PBS dispensing data using PPRL. Live and stillborn neonates born between 2012 and 2019 in WA were included. The proportion of pregnancies during which the mother was dispensed a PBS medication was calculated, overall and by medication safety category. Factors associated with PBS medication dispensing were examined using logistic regression. PPRL linkage identified matching records for 97.4% of women with perinatal records. A total of 271 739 pregnancies were identified, with 158 585 (58.4%) pregnancies involving the dispensing of at least one PBS medication. Category A medications (those considered safe in pregnancy) were the most commonly dispensed (n = 119 126, 43.8%) followed by B3 (n = 51 135, 18.8%) and B1 (n = 42 388, 15.6%) medication (those with unknown safety). Over the study period, the dispensing of PBS medications in pregnancy increased (OR: 1.06, 95%CI: 1.06, 1.07). The strongest predictor of medication dispensing in pregnancy was pre-pregnancy dispensing (OR: 3.61, 95%CI: 3.54, 3.68). Other factors associated with medication use in pregnancy were smoking, older maternal age, obesity, and prior pregnancies. Privacy preserving record linkage provides a way to link cross-jurisdictional data while preserving patient confidentiality and data security. The dispensing of PBS medication in pregnancy was common and increased over time, with approximately 60% of women dispensed at least one medication during pregnancy.