WP Manifestindependent plugin directory
manifest / seo / eco-friendly-robots-txt

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.

★ 11stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/emilia-capital/eco-friendly-robots-txt/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

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

[!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/ecofriendly_robots/allowed_spiders - filter an array of user agents.
  • emilia/ecofriendly_robots/blocked_paths - filters an array of blocked paths.
  • emilia/ecofriendly_robots/allowed_paths - filters an array of allowed paths, should be subsets of blocked_paths.
  • emilia/ecofriendly_robots/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 style: composer fix-cs
  • PHP Lint: composer lint
  • PHP Unit tests: composer test