Eco-Friendly Robots.txt
Optimizes your site's robots.txt to reduce server load and CO2 footprint by blocking unnecessary crawlers while allowing major search engines and specific tools.
by Joost de Valk · github.com/emilia-capital/eco-friendly-robots-txt · website
★ 11stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/emilia-capital/eco-friendly-robots-txt/archive/refs/heads/main.zipDeclares an update source (Emilia-Capital/eco-friendly-robots-txt), so updates arrive through the plugin's own updater.
From the readme
Eco-Friendly Robots.txt
Optimizes your site's robots.txt to reduce server load and CO2 footprint by blocking unnecessary crawlers while allowing major search engines and specific tools.
Test this plugin on the WordPress playground
Installation
Download the plugin right here and install it.
[!WARNING]
The plugin will delete your existing robots.txt file, if one exists on your server, although it'll try to back it up. It'll restore it, when it can, when you uninstall the plugin.
Default output
The default output of this plugin can be seen here on joost.blog or here on emilia.capital.
Filters
The plugin exposes the following filters:
emilia/ecofriendlyrobots/allowedspiders - filter an array of user agents.
emilia/ecofriendlyrobots/blockedpaths - filters an array of blocked paths.
emilia/ecofriendlyrobots/allowedpaths - filters an array of allowed paths, should be subsets of blockedpaths.
emilia/ecofriendlyrobots/output - filters the entire output as a string.
Development
If you're developing on this plugin, you will probably want to run tests and lint. You can do that by running the following commands:
PHP Code style: composer check-cs
PHP Autofixer for code sty