The concept of self-containment in new towns has been widely discussed from social and economic perspectives. However, localized interpretations within the context of China's development, particularly regarding climate adaptability and urban heat island (UHI) mitigation, are scarce. To fill this gap, our research analyzed self-containment from the perspectives of urban spatial scale and land use function. Focusing on Shanghai’s five new towns, we empirically demonstrated how self-containment influenced the UHI effects from 2005 to 2020, employing the Geodetector method. The findings reveal that during the daytime, the intensity of UHI in new towns decreased, serving as vital connectivity nodes of UHI within the region. Conversely, during the nighttime, both the intensity and area of UHI showed an increasing trend. The research confirmed that expanding the urban scale and functional diversity are effective strategies for mitigating the UHI. Based on these findings, we offer practical suggestions for the development of new towns: Increase population size while ensuring coordination with development scale; enhance mixed-use functions in large-scale development projects like university towns and industrial parks; and be vigilant of potential functional decline in central areas and increasing thermal impact due to new town development. Overall, this study enriches our understanding of self-containment in Chinese new towns and provides valuable insights for mitigating UHI in other similar contexts.