Metal–organic frameworks (MOFs) are shown to be good examples of a new class of crystalline porous materials for guest encapsulation. Since the encapsulation/release of guest molecules in MOF hosts is a reversible process in nature, how to prevent the leaching of guests from the open pores with minimal and nondestructive modifications of the structure is a critical issue. To address this issue, we herein propose a novel strategy of encapsulating guests by introducing size-matching organic ligands as bolts to lock the pores of the MOFs through deliberately anchoring onto the open metal sites in the pores. Our proposed strategy provides a mechanical way to prevent the leaching of guests and thereby has less dependence on the specific chemical environment of the hosts, thus making it applicable for a wide variety of existing MOFs once the size-matching ligands are employed.