A self-healing hydrogel is prepared by crosslinking acrylamide with a host-guest macro-crosslinker assembled from poly(β-cyclodextrin) nanogel and azobenzeneacrylamide. The photoisomerizable azobenzene moiety can change its binding affinity with β-cyclodextrin, therefore the crosslinking density and rheology property of the hydrogel can be tuned with light stimulus. The hydrogel can repair its wound autonomously through the dynamic host-guest interaction. In addition, the wounded hydrogel will lose its ability of self-healing when exposed to ultraviolet light, and the self-healing behavior can be recovered upon the irradiation of visible light. The utilizing of host-guest macro-crosslinking approach manifests the as-prepared hydrogel reversible and light-switchable self-healing property, which would broaden the potential applications of self-healing polymers.