PHPackages                             frosty-media/wp-rest-cop - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. frosty-media/wp-rest-cop

ActiveWordpress-plugin[Authentication &amp; Authorization](/categories/authentication)

frosty-media/wp-rest-cop
========================

A WordPress plugin for managing access to the WP REST API.

2.0.0(11mo ago)10GPL-2.0-or-laterPHPPHP ^8.3CI passing

Since May 20Pushed 4mo agoCompare

[ Source](https://github.com/Frosty-Media/wp-rest-cop)[ Packagist](https://packagist.org/packages/frosty-media/wp-rest-cop)[ RSS](/packages/frosty-media-wp-rest-cop/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (1)Dependencies (17)Versions (2)Used By (0)

WP REST Cop
===========

[](#wp-rest-cop)

[![WP Rest Cop](.github/wp-rest-cop.jpg?raw=true "WP Rest Cop")](.github/wp-rest-cop.jpg?raw=true)

![PHP from Packagist](https://camo.githubusercontent.com/fcb8e824b9f3b8b6fe6a3063d4884df5b7d6ac7c81c73c30ab4de83dc78d304f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f46726f7374792d4d656469612f77702d726573742d636f702e737667)[![Latest Stable Version](https://camo.githubusercontent.com/fb352d2e7a1a0553158f409f6fa5b61fa783b122423c249886bae119f11af0b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f46726f7374792d4d656469612f77702d726573742d636f702e737667)](https://packagist.org/packages/Frosty-Media/wp-rest-cop)[![Total Downloads](https://camo.githubusercontent.com/44e4e19f251e6ac71a0c46e348152d5ed494b859677a5d7ad08397226e6e40f5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f46726f7374792d4d656469612f77702d726573742d636f702e737667)](https://packagist.org/packages/Frosty-Media/wp-rest-cop)[![License](https://camo.githubusercontent.com/d55f13775af7cc64d253fe749cc316d1b9e5645530ccb45ccb953fa0056423cd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f46726f7374792d4d656469612f77702d726573742d636f702e737667)](https://packagist.org/Frosty-Media/wp-rest-cop)[![Build Status](https://github.com/Frosty-Media/wp-rest-cop/actions/workflows/main.yml/badge.svg)](https://github.com/Frosty-Media/wp-rest-cop/actions/workflows/main.yml/badge.svg)

Manage access to the WP REST API with rate limits and IP-based rules.

Rate Limits
-----------

[](#rate-limits)

Rate limits allow for configuring the number of requests a client can make within a certain interval. The default in *WP Rest Cop* is 60 requests per minute.

The rate limit functionality uses [transients](https://developer.wordpress.org/apis/transients/)which will use [persistent object cache](https://codex.wordpress.org/Class_Reference/WP_Object_Cache) if present.

### Headers

[](#headers)

A few headers are sent with every request so clients can keep track of their current limit:

HeaderDescription`X-Rate-Limit-Limit`Requests allowed per interval.`X-Rate-Limit-Rules`Default rule set to client "Ip".`X-Rate-Limit-Remaining`Remaining requests that are allowed in the current interval.`X-Rate-Limit-Reset`Seconds until the limit is reset.If a client has reached their limit, an additional header will be sent:

HeaderDescription`Retry-After`Seconds until the limit is reset.Clients may send a `HEAD` request to view their current limit without ticking the meter.

### Configuring Settings

[](#configuring-settings)

Configure the default `interval` &amp; `limit` settings using the simple API from the main plugin instance:

```
