In this paper, we study the analogue of the Shafarevich conjecture for polarized Calabi–;Yau varieties. We use variations of Hodge structures and Higgs bundles to establish a criterion for the rigidity of families. We then apply the criterion to obtain that some important and typical families of Calabi–Yau varieties are rigid, for examples., Lefschetz pencils of Calabi–Yau varieties, strongly degenerated families (not only for families of Calabi–Yau varieties), families of Calabi–Yau varieties admitting a degeneration with maximal unipotent monodromy.