This repository contains code lists and example code for data cleaning of vaccination data in electronic health records (EHRs). Example code lists folders are provided for: Measles, Mumps and Rubella vaccines; Diphtheria, Tetanus and Pertussis vaccines; Pneumococcus infections vaccines. Each folder contains example code lists for the different categories which can be applied to vaccine code lists. The provided R scripts show three different examples of how vaccine data in CPRD Aurum was cleaned. It also contains exploratory and descriptive steps used to determine a recommended minimum age and minimum time interval between different doses of the same vaccine type. Depending on the vaccine and setting of interest, these steps should be repeated accordingly for other vaccines or settings. Interim results of different cleaning steps are included as comments in the code, however, some numbers were suppressed due to small numbers.