Nature offers a vast array of biological building blocks that can be combined with synthetic materials to generate a variety of hierarchical architectures. Viruses are particularly interesting in this respect because of their structure and the possibility of them functioning as scaffolds for the preparation of new biohybrid materials. We report here that cowpea chlorotic mottle virus particles can be assembled into well-defined micrometre-sized objects and then reconverted into individual viruses by application of a short optical stimulus. Assembly is achieved using photosensitive dendrons that bind on the virus surface through multivalent interactions and then act as a molecular glue between the virus particles. Optical triggering induces the controlled decomposition and charge switching of dendrons, which results in the loss of multivalent interactions and the release of virus particles. We demonstrate that the method is not limited to the virus particles alone, but can also be applied to other functional protein cages such as magnetoferritin.