Aims: Many risk prediction models have been proposed for heart failure (HF), but few studies have used only information available to general practitioners (GPs) in primary care electronic health records (EHRs). We describe the predictors and performance of models built from GP‐based EHRs in two cohorts of patients 10 years apart. Methods and results: Linked primary and secondary care data for incident HF cases in England were extracted from the Clinical Practice Research Datalink for 2001–02 and 2011–12. Time‐to‐event models for all‐cause mortality were developed using a long list of potential baseline predictors. Discrimination and calibration were calculated. A total of 5966 patients in 156 general practices were diagnosed in 2001–02, and 12 827 patients in 331 practices were diagnosed in 2011–12. The 5‐year survival rate was 40.0% in 2001–02 and 40.2% in 2011–12, though the latter population were older, frailer, and more comorbid; for 2001–02, the 10‐year survival was 20.8% and 15‐year survival 11.1%. Consistent predictors included age, male sex, systolic blood pressure, body mass index, GP domiciliary visits before diagnosis, and some comorbidities. Model performance for both time windows was modest (c = 0.70), but calibration was generally excellent in both time periods. Conclusions: Information routinely available to UK GPs at the time of diagnosis of HF gives only modest predictive accuracy of all‐cause mortality, making it hard to decide on the type, place, and urgency of follow‐up. More consistent recording of data relevant to HF (such as echocardiography and natriuretic peptide results) in GP EHRs is needed to support accurate prediction of healthcare needs in individuals with HF. [ABSTRACT FROM AUTHOR]