WordPress filter hook · part of WordPress core

rest_enabled

A WordPress core filter that 26 plugins also fire themselves, running on 4M+ sites between them.

“This filter is documented in wp-includes/rest-api/class-wp-rest-server.php”

How to use rest_enabled

It's a filter: your callback receives the value, and must return the (changed) value. Add this to your theme's functions.php or a small custom plugin:

functions.php
add_filter( 'rest_enabled', function( $value ) {
	// Change $value here.
	return $value;
}, 10, 1 );

Argument names come from Jetpack's source. Other plugins may pass different values: check the call in the plugin you're targeting below.

This hook is fired by WordPress core too. Official reference on developer.wordpress.org →

26 plugins that fire rest_enabled

Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.

  1. Jetpack icon Jetpack3+ million installs apply_filters( 'rest_enabled', true ) _inc/lib/admin-pages/class.jetpack-admin-page.php:163
  2. Slider, Gallery, and Carousel by MetaSlider icon Slider, Gallery, and Carousel by MetaSlider500,000+ installs apply_filters( 'rest_enabled', true ) admin/Pages.php:466
  3. Jetpack Boost icon Jetpack Boost200,000+ installs apply_filters( 'rest_enabled', true ) jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php:1159
  4. YARPP icon YARPP100,000+ installs apply_filters( 'rest_enabled', true ) classes/YARPP_Core.php:97
  5. Jetpack Protect icon Jetpack Protect100,000+ installs apply_filters( 'rest_enabled', true ) jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php:1159
  6. Jetpack VaultPress Backup icon Jetpack VaultPress Backup20,000+ installs apply_filters( 'rest_enabled', true ) jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php:1091
  7. Echo Knowledge Base icon Echo Knowledge Base10,000+ installs apply_filters( 'rest_enabled', true ) includes/ai/admin/class-epkb-ai-dashboard-tab.php:485
  8. Stripe Payment Forms by WP Simple Pay icon Stripe Payment Forms by WP Simple Pay8,000+ installs apply_filters( 'rest_enabled', true ) includes/core/functions/shared.php:183
  9. Jetpack VideoPress icon Jetpack VideoPress7,000+ installs apply_filters( 'rest_enabled', true ) jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php:1049
  10. Jetpack Search icon Jetpack Search5,000+ installs apply_filters( 'rest_enabled', true ) jetpack_vendor/automattic/jetpack-my-jetpack/src/class-initializer.php:1091
  11. Squeeze icon Squeeze3,000+ installs apply_filters( 'rest_enabled', true ) inc/helpers.php:1656
  12. Vimeotheque icon Vimeotheque2,000+ installs apply_filters( 'rest_enabled', true ) includes/libs/admin/page/status-page.class.php:387
  13. Hippoo Mobile App for WooCommerce icon Hippoo Mobile App for WooCommerce1,000+ installs apply_filters( 'rest_enabled', true ) app/utils.php:109
  14. REST API Toolbox icon REST API Toolbox1,000+ installs apply_filters( 'rest_enabled', true ) includes/wp-cli/class-rest-api-toolbox-rest-api-command.php:107
  15. Event Tickets with Ticket Scanner icon Event Tickets with Ticket Scanner1,000+ installs apply_filters( 'rest_enabled', true ) sasoEventtickets_Options.php:369
  16. StreamWeasels Twitch Integration icon StreamWeasels Twitch Integration1,000+ installs apply_filters( 'rest_enabled', true ) admin/partials/streamweasels-admin-sidebar.php:214
  17. StreamWeasels YouTube Integration icon StreamWeasels YouTube Integration1,000+ installs apply_filters( 'rest_enabled', true ) admin/partials/streamweasels-youtube-admin-sidebar.php:162
  18. Geo Controller icon Geo Controller1,000+ installs apply_filters( 'rest_enabled', true ) inc/classes/Utilities.php:1958
  19. Chabok icon Chabok700+ installs apply_filters( 'rest_enabled', true ) includes/chabok-helper-functions.php:404
  20. Peppol e-Invoicing Integration by SendPol icon Peppol e-Invoicing Integration by SendPol80+ installs apply_filters( 'rest_enabled', true ) includes/class-sendpol-wc-admin.php:2072
  21. Atlas for WP icon Atlas for WP30+ installs apply_filters( 'rest_enabled', true ) includes/class-rest-availability.php:107
  22. JorgeCastro icon JorgeCastro30+ installs apply_filters( 'rest_enabled', true ) classes/Core/Plugin.php:261
  23. GhostGate icon GhostGate20+ installs apply_filters( 'rest_enabled', true ) inc/admin-ui.php:3403
  24. Final POS icon Final POS10+ installs apply_filters( 'rest_enabled', true ) includes/common-functions.php:380
  25. Xerotact SHIELD-X Security icon Xerotact SHIELD-X SecurityFewer than 10 installs apply_filters( 'rest_enabled', true ) includes/Admin/AdminPage.php:15187
  26. Gexiro Content Protection icon Gexiro Content ProtectionFewer than 10 installs apply_filters( 'rest_enabled', true ) admin/class-admin-page.php:38

Need a customisation built on this hook?

Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.