Methods allowing light energy to be modulated in a controllable fashion are potentially important for finding the correlation between light-related environmental factors and aging-related lifespan. Here, we report photo- and thermo-regulation based on photonic crystals (PCs) for extended longevity of C. elegans. We show that PCs can function as a regulator of visible spectrum to tune photonic energy received by C.elegans. We provide direct evidence that lifespan depends on photonic energy, and the use of PCs reflecting blue light (440–537 nm) gives 8.3 % increasement in lifespan. We demonstrate that the exposure to modulated light alleviates photo-oxidative stress and unfolded-protein response. We realize reflective passive cooling temperature using PCs, and favorable low temperature could be created for worms to extend lifespan. This work offers a new path based on PCs to resist negative effects light and temperature for longevity, provides an available platform for studying the role of light in aging.