  Searches for rare $B_s^0$ and $B^0$ decays into four muons are performed
using proton-proton collision data recorded by the LHCb experiment,
corresponding to an integrated luminosity of 9 $\text{fb}^{-1}$. Direct decays
and decays via light scalar and $J/\psi$ resonances are considered. No evidence
for the six decays searched for is found and upper limits at the 95% confidence
level on their branching fractions ranging between $1.8\times10^{-10}$ and
$2.6\times10^{-9}$ are set.
