function register_yoast_seo_rest_fields() { // Register Yoast SEO Title for access in REST API register_rest_field( 'post', '_yoast_wpseo_title', [ 'get_callback' => 'get_yoast_seo_rest_field', 'update_callback' => 'update_yoast_seo_rest_field', 'schema' => null, ]); // Register Yoast SEO Meta Description for access in REST API register_rest_field( 'post', '_yoast_wpseo_metadesc', [ 'get_callback' => 'get_yoast_seo_rest_field', 'update_callback' => 'update_yoast_seo_rest_field', 'schema' => null, ]); } add_action( 'rest_api_init', 'register_yoast_seo_rest_fields' ); function get_yoast_seo_rest_field( $object, $field_name, $request ) { return get_post_meta( $object['id'], $field_name, true ); } function update_yoast_seo_rest_field( $value, $post, $field_name, $request, $object_type ) { if ( ! $value || ! is_string( $value ) ) { return; } return update_post_meta( $post->ID, $field_name, sanitize_text_field( $value ) ); }

Our latest news: Discover Microsoft Fabric. Read

Real Estate PowerBI Center

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Real Estate Technical Data App

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Political Campaign Data Room

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.