Measure your website’s carbon footprint within WordPress

What if your WordPress site could tell you about its carbon footprint? And warn you if it is too large and gave you tips on how to lower it?

WordPress (WP) already has a self-analysis feature called Site Health. Under the Tools menu, administrators can check their site’s status based on several tests. For example, a test determines the PHP version and whether it is up-to-date. It provides background information about the current and minimum supported versions.

Site Health provides even more useful information about the website under its Info tab, including directory and database sizes, server configuration, media handling and so on.

However, no information is available yet about the website’s carbon footprint. With the rise of the climate emergency and the impact of the internet and digital technologies, this may be the time to do something about that.

Websites can be dirty

Yes, websites have a carbon footprint. The electricity used to power them still originates mostly from fossil fuels. Even if they are hosted using renewable energy, there is no way to control the network the data travels through when a web page is viewed, nor the devices used to view it. To state it a bit oversimplified, the larger the size of a web page is, the more energy is needed to load it.

And that is only one website…

Estimate the carbon footprint

A website’s carbon footprint can be estimated using the Website Carbon Calculator. The tool tells you whether your site runs on renewable energy and the amount of CO2 generated when visiting the tested page. More importantly, it puts the data in context and gives you an idea about how your web page compares to other pages measured. A positive result can be:

Hurrah! This web page is cleaner than 82% of web pages tested.

But what if WP could do the same within Site Health, directly in the admin?

A plugin to set footprint in the WP admin

Inspired by the above, the WP Sustainable plugin by Javier Casares and the belief that WP could be used to raise awareness around digital sustainability, a first version of the Carbon Footprint plugin was born.

The plugin uses the Website Carbon API, kindly provided by Wholegrain Digital, and brings the information provided by the Website Carbon Calculator into the WP admin.

Initial carbon footprint information

The following information is available in the initial version of the plugin:

  • a test that determines whether the site is running on renewable energy
  • a test that compares the homepage’s carbon footprint to other websites measured by the Website Carbon Calculator

The plugin provides further insight into

  • the energy used by your server
  • the size of the homepage
  • the amount of CO2 emitted each time one visits the homepage

Actionable advice

The plugin provides links to external resources to test other pages of the website and to learn more about improving the website’s sustainability.

You can see some screenshots below with examples of test results, the displayed information and the links to external resources. I think it is very important to state the benefits and be positive, which might not yet be optimal for now.

A warning when needed

The initial version of the plugin is completely integrated into the existing infrastructure of Site Health, without adding much bloat or additional features to the admin. However, in the case that the homepage’s footprint is very large (i.e. larger than 90% of tested pages), a dashboard widget is shown for administrators with detailed background information about the impact. This case is considered as a critical issue in the Site Health test as well, making the relevance of doing something about this important.

Example of dirty homepage dashboard widget

Benefits

WP is the most popular content management system. Including information about carbon footprint into the WP admin would increase visibility about the issue and could raise awareness around the environmental impact of websites, and digital technology in general. By providing actionable advice in the form of links to external resources, site administrators could act to decrease their website’s carbon footprint. This would not only mitigate their environmental impact, but would also lead to other advantages for SEO, user-friendliness and so on.

Further development and ideas

What else could a plugin like this do? Is there more useful data related to sustainability that it could display? Feel free to visit the GitHub repo and contribute.

This plugin is part of my work for the WP Sustainability Team. The team looks for ways to decrease the footprint of the WP community, among others by raising awareness around the carbon footprint of websites. A big thanks to everyone who has contributed in any way.

in