WordPress filter hook

aioseo_is_rest_api_request

Fired by 5 WordPress plugins, running on 2.5M+ sites between them.

How to use aioseo_is_rest_api_request

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( 'aioseo_is_rest_api_request', function( $isRestApiRequest ) {
	// Change $isRestApiRequest here.
	return $isRestApiRequest;
}, 10, 1 );

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

5 plugins that fire aioseo_is_rest_api_request

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

  1. All in One SEO icon All in One SEO2+ million installs apply_filters( 'aioseo_is_rest_api_request', $isRestApiRequest ) app/Common/Traits/Helpers/WpContext.php:1073
  2. Broken Link Checker by AIOSEO icon Broken Link Checker by AIOSEO200,000+ installs apply_filters( 'aioseo_is_rest_api_request', $isRestApiRequest ) app/Traits/Helpers/Wp.php:231
  3. Table of Contents Plus icon Table of Contents Plus200,000+ installs apply_filters( 'aioseo_is_rest_api_request', $isRestApiRequest ) app/Traits/Helpers/Wp.php:231
  4. 404 to 301 icon 404 to 301100,000+ installs apply_filters( 'aioseo_is_rest_api_request', $isRestApiRequest ) app/Traits/Helpers/Wp.php:230
  5. Duplicate Post by AIOSEO icon Duplicate Post by AIOSEO100+ installs apply_filters( 'aioseo_is_rest_api_request', $isRestApiRequest ) app/Traits/Helpers/Wp.php:441

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.