WP REST Yoast Meta
Explore this tool and check the official listing for its latest features and requirements.
About this tool.
This plugin is no longer updated, but is open for adoption As of Yoast SEO version 16.7 the functionality provided by this plugin is now part of the Yoast SEO plugin itself. This plugin will no longer be updated, but is open for adoption. If you are interested in adopting this plugin, please contact the authors.
Are you using WordPress for a headless set-up, using the WP REST API? And would you like to use the Yoast SEO plugin just like you would for any other project? This plugin adds the meta tags generated by the Yoast SEO plugin to the WP REST API output, allowing your headless set-up to implement them. Also when you are using Yoast SEO Premium you have the option to retrieve redirects throught the API: this plugin adds a custom endpoint ( /wp-rest-yoast-meta/v1/redirects ) to provide those redirects in a JSON format. Since Yoast 11.0 JSON LD Schema.org data is also supported and is now also available through the WP REST API when using this plugin.
Installation from within WordPress
- 01Visit ‘Plugins > Add New’ (or ‘My Sites > Network Admin > Plugins > Add New’ if you are on a multisite installation).
- 02Search for ‘WP REST Yoast Meta’.
- 03Activate the WP REST Yoast Meta plugin through the ‘Plugins’ menu in WordPress.
Installation manually
- 04Upload the wp-rest-yoast-meta folder to the /wp-content/plugins/ directory.
- 05Activate the WP REST Yoast Meta plugin through the ‘Plugins’ menu in WordPress.
Frequently asked questions.
I have installed the plugin, where can I find the Yoast meta tags?
For each post/page/… you can find an array of meta tags in that object under yoast_meta .
I have installed the plugin, where can I find the Yoast JSON LD Schema.org data?
For each post/page/… you can find an array of JSON LD data in that object under yoast_json_ld .
I have created a custom post type, will the plugin add the meta tags to that post type?
Yes, the plugin will automatically add meta tags to custom post types. Unless you have created a custom WP_REST_Controller for it and have not implemented the rest_prepare_POSTTYPE filter.
Can I add my own meta tags?
Yes you can! Use the hook wp_rest_yoast_meta/filter_yoast_meta like this:
/** * Add a custom meta tag. */ function wpym_add_custom_meta_tag( $yoast_meta ) { $yoast_meta[] = array( 'property' => 'og:type', 'content' => 'article' ); return $yoast_meta; } add_filter( 'wp_rest_yoast_meta/filter_yoast_meta', 'wpym_add_custom_meta_tag', 10, 1); I have the Yoast SEO Premium plugin installed, will it work?