PHPackages                             php-middleware/block-robots - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. php-middleware/block-robots

ActiveLibrary[HTTP &amp; Networking](/categories/http)

php-middleware/block-robots
===========================

PSR-15 middleware to avoid search engine indexing with PSR-7

1.1.0(9y ago)733.2k[1 PRs](https://github.com/php-middleware/block-robots/pulls)PHPPHP &gt;=5.6

Since Sep 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/php-middleware/block-robots)[ Packagist](https://packagist.org/packages/php-middleware/block-robots)[ RSS](/packages/php-middleware-block-robots/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (6)Used By (0)

block-robots middleware [![Build Status](https://camo.githubusercontent.com/a64db0bc750cdc63d47f1bc6f1e8d79891ff715490c8ee7bf51465ea5dd8491a/68747470733a2f2f7472617669732d63692e6f72672f7068702d6d6964646c65776172652f626c6f636b2d726f626f74732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/php-middleware/block-robots)
========================================================================================================================================================================================================================================================================================================================================

[](#block-robots-middleware-)

PSR-15 middleware to avoid search engine indexing with PSR-7

This middleware provide framework-agnostic possibility to preventing your site from being indexed.

How it works?
-------------

[](#how-it-works)

- Add `X-Robots-Tag` header with `noindex, nofollow` value.
- Add `robots.txt` "file" with `User-Agent: * Disallow: /` body

Installation
------------

[](#installation)

```
composer require php-middleware/block-robots
```

```
$blockRobotsMiddleware = new PhpMiddleware\BlockRobots\BlockRobotsMiddleware();

$app = new MiddlewareRunner();
$app->add($blockRobotsMiddleware);
$app->run($request, $response);
```

It's just works with any modern php framework!
----------------------------------------------

[](#its-just-works-with-any-modern-php-framework)

Middleware tested on:

- [Expressive](https://github.com/zendframework/zend-expressive)

Middleware should works with:

- [Slim 3.x](https://github.com/slimphp/Slim)

And any other modern framework [supported middlewares and PSR-7](https://mwop.net/blog/2015-01-08-on-http-middleware-and-psr-7.html).

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~298 days

Total

3

Last Release

3294d ago

PHP version history (2 changes)1.0.0PHP &gt;=5.5

1.1.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/93a2113828a101b473d256ef12e6bd89d67bcbef0621704cfeb3304c98a16a47?d=identicon)[snapshotpl](/maintainers/snapshotpl)

---

Top Contributors

[![snapshotpl](https://avatars.githubusercontent.com/u/312655?v=4)](https://github.com/snapshotpl "snapshotpl (13 commits)")

---

Tags

googlemiddlewarepsr-15psr-7robots-txtseopsrpsr-7middlewarepsr-15seorobots

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/php-middleware-block-robots/health.svg)

```
[![Health](https://phpackages.com/badges/php-middleware-block-robots/health.svg)](https://phpackages.com/packages/php-middleware-block-robots)
```

###  Alternatives

[psr/http-server-middleware

Common interface for HTTP server-side middleware

18291.2M1.5k](/packages/psr-http-server-middleware)[mezzio/mezzio

PSR-15 Middleware Microframework

3883.6M97](/packages/mezzio-mezzio)[php-middleware/php-debug-bar

PHP Debug Bar PSR-15 middleware with PSR-7

76433.5k2](/packages/php-middleware-php-debug-bar)[mezzio/mezzio-skeleton

Laminas mezzio skeleton. Begin developing PSR-15 middleware applications in seconds!

12726.2k](/packages/mezzio-mezzio-skeleton)[mezzio/mezzio-authentication

Authentication middleware for Mezzio and PSR-7 applications

121.6M26](/packages/mezzio-mezzio-authentication)[idealo/php-middleware-stack

Implementation of HTTP Middleware PSR-15 specification

318.9k](/packages/idealo-php-middleware-stack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
