Secondary lymphoid organs (SLOs) are tissues that facilitate the induction of adaptive immune responses. These organs capture pathogens to limit their spread throughout the body, bring antigen-presenting cells into productive contact with their cognate lymphocytes and provide niches for the differentiation of immune effector cells. Therefore, the microanatomy of SLOs defines the ability of an organism to respond to pathogens. SLO microarchitecture is, at the same time, extremely adaptable to environmental changes. In this Review, we discuss recent insights into the function and plasticity of the SLO microenvironment with regards to antimicrobial immune defence.