Background: This study assessed the association between heart failure (HF) medication (angiotensinconverting-enzyme inhibitors (ACEI)/angiotensin-receptor blockers (ARB), beta-blockers (BB), mineralocorticoid-receptor antagonists (MRA) and diuretics) and HF readmissions in a real-world unselected group of patients after a first hospital admission for HF. Furthermore we analysed readmission rates for ACEI versus ARB and for carvedilol versus β1-selective BB and we investigated the effect of HF medication in relation to time since discharge. Methods and findings: Medication at discharge was determined with dispensing data from the Dutch PHARMO Database Network including 22,476 patients with HF between 2001 and 2015. After adjustment for age, gender, number of medications and year of admission no associations were found for users versus non-users of ACEI/ARB (hazard ratio, HR = 1.01; 95%CI 0.96-1.06), BB (HR = 1.00; 95%CI 0.95-1.05) and readmissions. The risk of readmission for patients prescribed MRA (HR = 1.11; 95%CI 1.05-1.16) or diuretics (HR = 1.17; 95%CI 1.09-1.25) was higher than for non-users. The HR for ARB relative to ACEI was 1.04 (95%CI 0.97- 1.12) and for carvedilol relative to β1-selective BB 1.33 (95%CI 1.20-1.46). Post-hoc analyses showed a protective effect shortly after discharge for most medications. For example one month post discharge the HR for ACEI/ARB was 0.77 (95%CI 0.69-0.86). Although we did try to adjust for confounding by indication, probably residual confounding is still present. Conclusions: Patients who were prescribed carvedilol have a higher or at least a similar risk of HF readmission compared to β1-selective BB. This study showed that all groups of HF medication-some more pronounced than others-were more effective immediately following discharge.