ABSTRACT We present 850 $\mu$m polarized observations of the molecular cloud G34.26 + 0.15 taken using the POL-2 polarimeter mounted on the James Clerk Maxwell Telescope (JCMT). G34.26 + 0.15 is a hub–filament system with ongoing high-mass star formation, containing multiple H ii regions. We extend the histogram of relative orientations technique with an alternative application that considers the alignment of the magnetic field to the filaments and a H ii region boundary, denoted as the filament alignment factor ($\xi _{F}$) and the ellipse alignment factor ($\xi _{E}$), respectively. Using these metrics, we find that, although in general the magnetic field aligns parallel to the filamentary structure within the system in the north-west, the magnetic field structure of G34.26 + 0.15 has been radically reshaped by the expansion of an evolved H ii region in the south-east, which itself may have triggered further high-mass star formation in the cloud. Thus, we suggest high-mass star formation is occurring through both mass accretion as per the hub–filament model from one side and compression of gas under stellar feedback from the other. We also use HARP (Heterodyne Array Receiver Program) observations of C$^{18}$O from the CHIMPS survey to estimate the magnetic field strength across the cloud, finding strengths of $\sim$0.5–1.4 mG.