The chemical reactions and pathways involving macrolides, any of a large group of polyketide compounds that contain a large lactone ring with few or no double bonds and no nitrogen atoms, linked glycosidically to one or more sugar groups. The macrolides include the carbomycins, the erythromycins, oleandomycin, oligomycins, and the spiramycins, and act as antibiotics, mainly against Gram-positive bacteria.