• The strategy for the construction of rigid & flexible COFs was proposed. • The flexible units endow COFs with abundant potential active sites. • The active sites can be released in situ through controlled dissociation reactions. • The site-released COFs exhibit significant improvement on adsorption performance. Different from traditional covalent organic frameworks (COFs) with single structural mode, COFs constructed with unique alternating rigid and flexible structural elements can maximize the great advantages of COFs in both crystalline structure and application performance. Herein, a series of rigid & flexible COFs containing both rigid and flexible units were designed and synthesized. The rigid units can reduce the growth defects and maintain the regular crystalline structures. The flexible units endow COFs with abundant potential active sites that can be released through controlled dissociation reactions. Thus, the site-released multiple-site COFs exhibit significant improvement on adsorption performance towards mercury and uranium, with a maximum adsorption capacity increase of up to 61% compared to the original COFs. The strategy for the construction of rigid & flexible COFs and the controlled release of active sites points a new direction for the design and synthesis of COFs with multi-functional sites and outstanding application performance.