The active participation of rural residents in ecological protection is crucial for preserving the rural environment and advancing ecological civilization. However, existing literature often neglects the impact of rural residents' digital literacy and policy cognition on their adoption of eco-friendly behaviors. In the digital age, rural residents can efficiently access and utilize ecological information, deepen their policy cognition, and consequently, become more actively involved in ecological protection through enhancing their digital literacy. This enhancement is crucial for ensuring the smooth implementation of rural ecological policies at the grassroots level, thereby providing a strong impetus for the further development of rural ecological protection. Therefore, based on survey data from 851 respondents in four counties and cities in Hainan Province, this paper uses the Ordered Probit model to analyze the impact of digital literacy on rural residents' adoption of eco-friendly behaviors, supported by theoretical mechanism analysis. The results indicate that: (1) Digital literacy enhances the adoption of eco-friendly behaviors among rural residents; (2) The mechanism analysis shows that digital literacy promotes such adoption through improved policy cognition. Consequently, the government should actively promote digital technology education and training to improve rural residents' digital literacy. Therefore, targeted digital skills training policies should be developed according to the individual characteristics of rural residents. Additionally, promoting digital literacy to improve policy cognition will likely lead to greater engagement in eco-friendly behaviors.