carbon.txt is a single, recognisable place on your website, at
https://your-site.com/carbon.txt, where anyone can find out what your
organisation publishes about its own environmental impact.
This plugin builds that file for you. You describe your disclosures (the
public documents where you report your sustainability data) and the plugin
turns them into a valid carbon.txt, served straight from your site.
What you can do with it:
- Add your disclosures. One or more links to the documents that back
up your claims: your annual report, your sustainability page, a
certificate, and so on. Each one gets a document type, so readers know
what they are looking at. - Point at any document. Paste a URL, pick one of your published pages,
or choose a file from your media library. - Record your certifications. If your organisation holds a
certification (a B Corp, an ecolabel, an ISO standard), list it once and
link your disclosures to it. - Preview before you publish. The settings screen shows the exact file
that will be served, so you always know what visitors will get. - Start from what you already have. If a
carbon.txtalready exists on
your server, the plugin can read it and offer to import what it finds. - Keep a copy. Your disclosures stay saved when you deactivate the
plugin, and you can copy or download them at any time.
How it works
Document types. The picker offers the document types the carbon.txt
syntax defines. The Green Web Foundation has deprecated the “web page”
type in favour of “sustainability page”, so it is no longer offered, and
new disclosures start at “sustainability page”. Disclosures that already
use “web page” keep working. They are labelled as deprecated in the editor,
so you can move them on when you get the chance.
Required fields. A disclosure needs a URL, and a certification needs a
title and a URL. Anything still missing one of those is skipped when you
save. The editor marks every field as required or optional, and tells you
what was left out.
Certifications. Each certification you list gets an id generated from
its title, and your disclosures reference that id. Only complete
certifications appear in the list you can choose from, so a half-finished
one never shows up as a blank entry.
The file itself. It is generated on request from your settings and
cached, so there is no physical file to manage and it survives deploys. It
is served from your site root even with plain permalinks. Every save
re-stamps the last_updated date.
An existing file on your server. If a carbon.txt already exists at
your domain root or at /.well-known/carbon.txt, the settings screen
warns you: your web server may keep serving that file instead of the one
this plugin generates. You can import the disclosures it finds, and the old
file is then permanently deleted once you save.
DNS delegation. If your domain has a carbon-txt-location TXT record
(see https://carbontxt.org/faq), that takes priority over any file this
plugin generates. The settings screen warns you when it finds one, so you
are not left wondering why your changes seem to have no effect.
Validation. After each save, the plugin asks the Green Web Foundation’s
hosted validator to check your domain. Their validator fetches your live
carbon.txt from the web, so this needs a publicly reachable site. Local
and staging domains are skipped. No key or setup is required, and validation
can be switched off from the settings screen. See “External services”
below for exactly what is sent, and where.
Removing the plugin. Deactivating keeps your disclosures and settings.
Deleting the plugin removes them, so the plugin offers to copy or download
your file first.
External services
This plugin connects to the carbon.txt validator API operated by The Green
Web Foundation, to check that the carbon.txt file your site publishes can be
read from the public web. That check is the only thing it is used for.
What is sent. Your site’s fully-qualified domain name — for example
example.com — together with the shared API key that identifies this
plugin. No file contents, no page content, no visitor or user data, and
nothing that identifies you.
When. Once per save of this plugin’s settings, and only while the
“Validate with the Green Web Foundation after saving” option is ticked. It
is skipped on domains that are not publicly reachable, such as local and
staging sites. Untick it in the settings and nothing is sent.
Where. From your WordPress server, over HTTPS, to
https://carbon-txt-api.greenweb.org/. The validator then fetches
https://your-domain/carbon.txt itself, which is why a passing result tells
you the file is publicly readable rather than blocked by a firewall, CAPTCHA
or CDN. The Green Web Foundation also uses the aggregate results to measure
adoption of the carbon.txt standard.
This service is provided by The Green Web Foundation:
- Terms of use and API usage conditions:
https://developers.thegreenwebfoundation.org/api/carbon-txt/overview/ - Privacy policy: https://www.thegreenwebfoundation.org/privacy-statement/
- Service documentation: https://developers.thegreenwebfoundation.org/api/carbon-txt/
Development
This plugin is developed in the open on
GitHub.
Bug reports, questions and pull requests are welcome there.
The admin app’s source lives in src/. Build it with:
npm install && npm run build