Mechanical stoppering of a guest molecule prevents its self-assembly with a macrocycle unit, so that both species coexist in a medium but do not recognize each other. The application of a chemical or physical stimulus reverses mechanical stoppering and subsequently enables molecular recognition. This process, which occurs without cross-reactivity and is perceptible at the macroscopic scale, could facilitate programming on/off states in supramolecular materials and molecular devices.