An increased prevalence of the inflammatory bowel diseases, ulcerative colitis and Crohn’s disease, was found amongst residents in a livestock dense area. We hypothesised that exposure to livestock farms might be a substantial environmental factor that contributes to the development of these diseases and that in the lead up to inflammatory bowel diseases potential risk factors can be identified. This study aimed to investigate the contribution of livestock exposure to the development of these diseases and the clinical events prior to the diagnosis. Electronic health records from 2006–2013 of general practices were used. The study population consisted of patients with a new diagnosis of inflammatory bowel diseases resident in areas with a high (n = 141) or lower (n = 109) livestock density. Patients with low back pain (n = 10,469) were used as controls. For those in a livestock dense area, distance to livestock farms was determined. Associations between morbidities and drug prescriptions in the reporting year and three years previous to the diagnosis, and the residential proximity to livestock exposure were investigated with multivariable logistic regression analyses. Acute and chronic morbidity of the gastrointestinal tract and associated drug prescriptions were predictive for the development of inflammatory bowel diseases. In addition, a positive association was found between infections and living within 500 meter of poultry farms and the development of inflammatory bowel diseases [OR: 3.3 (1.1–9.9)]. Nonetheless, overall livestock exposure contributed little to the development of these diseases. These results suggest that exposure to livestock farms on its own contributes minimal to the development of inflammatory bowel diseases. Nonetheless, having infections appeared to be a risk factor for neighbouring residents of poultry farms. More research is warranted to explain the increased prevalence of inflammatory bowel diseases amongst residents in areas with a high density of livestock.