Immune cell trafficking is a complex and tightly regulated process that is indispensable for the body's fight against pathogens. However, it is also increasingly acknowledged that dysregulation of cell trafficking contributes to the pathogenesis of immune-mediated inflammatory diseases (IMIDs) in gastroenterology and hepatology, such as inflammatory bowel disease and primary sclerosing cholangitis. Moreover, altered cell trafficking has also been implicated as a crucial step in the immunopathogenesis of other IMIDs, such as rheumatoid arthritis and multiple sclerosis. Over the past few years, a central role of the gut in mediating these disorders has progressively emerged, and the partly microbiota-driven imprinting of particular cell trafficking phenotypes in the intestine seems to be crucially involved. Therefore, this Review highlights achievements in understanding immune cell trafficking to, within and from the intestine and delineates its consequences for immune-mediated pathology along the gut-liver, gut-joint and gut-brain axes. We also discuss implications for current and future therapeutic approaches that specifically interfere with homing, retention, egress and recirculation of immune cells.