Content Restriction but allow public REST API
You can use the REST_REQUEST constant to detect if this is a REST request, and if it’s not, apply your filter(s). Example: add_filter( ‘the_content’, ‘wpse418531_use_excerpt’ ); /** * Replaces the content with the excerpt, unless this is a REST request. * * @param string $content The post content. * @return string The filtered post content. … Read more