  We describe a procedure called panel collapse for replacing a CAT(0) cube
complex $\Psi$ by a "lower complexity" CAT(0) cube complex $\Psi_\bullet$
whenever $\Psi$ contains a codimension-$2$ hyperplane that is extremal in one
of the codimension-$1$ hyperplanes containing it. Although $\Psi_\bullet$ is
not in general a subcomplex of $\Psi$, it is a subspace consisting of a
subcomplex together with some cubes that sit inside $\Psi$ "diagonally". The
hyperplanes of $\Psi_\bullet$ extend to hyperplanes of $\Psi$. Applying this
procedure, we prove: if a group $G$ acts cocompactly on a CAT(0) cube complex
$\Psi$, then there is a CAT(0) cube complex $\Omega$ so that $G$ acts
cocompactly on $\Omega$ and for each hyperplane $H$ of $\Omega$, the stabiliser
in $G$ of $H$ acts on $H$ essentially.
  Using panel collapse, we obtain a new proof of Stallings's theorem on groups
with more than one end. As another illustrative example, we show that panel
collapse applies to the exotic cubulations of free groups constructed by Wise.
Next, we show that the CAT(0) cube complexes constructed by Cashen-Macura can
be collapsed to trees while preserving all of the necessary group actions. (It
also illustrates that our result applies to actions of some non-discrete
groups.) We also discuss possible applications to quasi-isometric rigidity for
certain classes of graphs of free groups with cyclic edge groups. Panel
collapse is also used in forthcoming work of the first-named author and Wilton
to study fixed-point sets of finite subgroups of $\mathrm{Out}(F_n)$ on the
free splitting complex. Finally, we apply panel collapse to a conjecture of
Kropholler, obtaining a short proof under a natural extra hypothesis.
