{"id":98847,"date":"2019-03-06T13:40:26","date_gmt":"2019-03-06T13:40:26","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/wp-rest-yoast-meta\/"},"modified":"2025-01-23T09:31:28","modified_gmt":"2025-01-23T09:31:28","slug":"wp-rest-yoast-meta","status":"publish","type":"plugin","link":"https:\/\/azb.wordpress.org\/plugins\/wp-rest-yoast-meta\/","author":16835804,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2025.1.0","stable_tag":"2025.1.0","tested":"5.7.15","requires":"4.7","requires_php":"5.4","requires_plugins":null,"header_name":"WP REST Yoast Meta","header_author":"Acato","header_description":"Add yoast meta information to the WP REST API","assets_banners_color":"9acba9","last_updated":"2025-01-23 09:31:28","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"","header_author_uri":"https:\/\/www.acato.nl","rating":5,"author_block_rating":0,"active_installs":1000,"downloads":32060,"num_ratings":6,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","faq","changelog"],"tags":{"2019.1.0":{"tag":"2019.1.0","author":"acato","date":"2019-03-06 13:37:57"},"2019.2.0":{"tag":"2019.2.0","author":"acato","date":"2019-06-16 11:51:15"},"2019.2.1":{"tag":"2019.2.1","author":"acato","date":"2019-06-27 21:08:14"},"2019.3.0":{"tag":"2019.3.0","author":"acato","date":"2019-10-15 14:08:40"},"2019.4.0":{"tag":"2019.4.0","author":"acato","date":"2019-10-17 09:40:56"},"2019.4.1":{"tag":"2019.4.1","author":"acato","date":"2019-10-18 12:12:58"},"2019.4.2":{"tag":"2019.4.2","author":"acato","date":"2019-10-20 19:40:59"},"2019.5.0":{"tag":"2019.5.0","author":"acato","date":"2019-10-29 15:10:57"},"2019.5.1":{"tag":"2019.5.1","author":"acato","date":"2019-11-07 09:00:56"},"2019.5.2":{"tag":"2019.5.2","author":"acato","date":"2019-11-22 20:56:03"},"2019.5.3":{"tag":"2019.5.3","author":"acato","date":"2019-12-12 14:13:35"},"2020.1.0":{"tag":"2020.1.0","author":"acato","date":"2020-01-16 10:21:53"},"2020.2.0":{"tag":"2020.2.0","author":"acato","date":"2020-04-30 11:39:27"},"2020.2.1":{"tag":"2020.2.1","author":"acato","date":"2020-06-08 10:19:27"},"2020.2.2":{"tag":"2020.2.2","author":"acato","date":"2020-09-07 09:57:14"},"2021.1.0":{"tag":"2021.1.0","author":"acato","date":"2021-01-07 08:50:29"},"2021.1.1":{"tag":"2021.1.1","author":"acato","date":"2021-04-20 09:57:13"},"2021.1.2":{"tag":"2021.1.2","author":"acato","date":"2021-07-07 09:41:06"},"2025.1.0":{"tag":"2025.1.0","author":"acato","date":"2025-01-23 09:31:28"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"6"},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":2045273,"resolution":"128x128","location":"assets","locale":""},"icon-128x128.png":{"filename":"icon-128x128.png","revision":2045273,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":2045273,"resolution":"256x256","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2045273,"resolution":"256x256","location":"assets","locale":""},"icon.svg":{"filename":"icon.svg","revision":2045273,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":2045273,"resolution":"1544x500","location":"assets","locale":""},"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":2045273,"resolution":"1544x500","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":2045273,"resolution":"772x250","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":2045273,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["2019.1.0","2019.2.0","2019.2.1","2019.3.0","2019.4.0","2019.4.1","2019.4.2","2019.5.0","2019.5.1","2019.5.2","2019.5.3","2020.1.0","2020.2.0","2020.2.1","2020.2.2","2021.1.0","2021.1.1","2021.1.2","2025.1.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":2045273,"resolution":"1","location":"assets","locale":""}},"screenshots":{"1":"The WP REST API output for the Hello World post example."},"jetpack_post_was_ever_published":false},"plugin_section":[74],"plugin_tags":[2845,1556,127987,2301,2227],"plugin_category":[],"plugin_contributors":[169381,167407],"plugin_business_model":[],"class_list":["post-98847","plugin","type-plugin","status-publish","hentry","plugin_section-adopt-me","plugin_tags-adopt-me","plugin_tags-api","plugin_tags-wp-rest","plugin_tags-wp-rest-api","plugin_tags-yoast","plugin_contributors-acato","plugin_contributors-rockfire","plugin_committers-acato","plugin_committers-rockfire"],"banners":{"banner":"https:\/\/ps.w.org\/wp-rest-yoast-meta\/assets\/banner-772x250.png?rev=2045273","banner_2x":"https:\/\/ps.w.org\/wp-rest-yoast-meta\/assets\/banner-1544x500.png?rev=2045273","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/wp-rest-yoast-meta\/assets\/icon.svg?rev=2045273","icon":"https:\/\/ps.w.org\/wp-rest-yoast-meta\/assets\/icon.svg?rev=2045273","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/wp-rest-yoast-meta\/assets\/screenshot-1.png?rev=2045273","caption":"The WP REST API output for the Hello World post example."}],"raw_content":"<!--section=description-->\n<p><em>This plugin is no longer updated, but is open for adoption<\/em>\nAs of Yoast SEO version 16.7 the functionality provided by this plugin is now <a href=\"https:\/\/developer.yoast.com\/customization\/apis\/rest-api\/\">part of the Yoast SEO plugin<\/a> 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.<\/p>\n\n<p>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 (<code>\/wp-rest-yoast-meta\/v1\/redirects<\/code>) 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.<\/p>\n\n<h3>Installation from within WordPress<\/h3>\n\n<ol>\n<li>Visit 'Plugins &gt; Add New' (or 'My Sites &gt; Network Admin &gt; Plugins &gt; Add New' if you are on a multisite installation).<\/li>\n<li>Search for 'WP REST Yoast Meta'.<\/li>\n<li>Activate the WP REST Yoast Meta plugin through the 'Plugins' menu in WordPress.<\/li>\n<\/ol>\n\n<h3>Installation manually<\/h3>\n\n<ol>\n<li>Upload the <code>wp-rest-yoast-meta<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory.<\/li>\n<li>Activate the WP REST Yoast Meta plugin through the 'Plugins' menu in WordPress.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='i%20have%20installed%20the%20plugin%2C%20where%20can%20i%20find%20the%20yoast%20meta%20tags%3F'><h3>I have installed the plugin, where can I find the Yoast meta tags?<\/h3><\/dt>\n<dd><p>For each post\/page\/... you can find an array of meta tags in that object under <code>yoast_meta<\/code>.<\/p><\/dd>\n<dt id='i%20have%20installed%20the%20plugin%2C%20where%20can%20i%20find%20the%20yoast%20json%20ld%20schema.org%20data%3F'><h3>I have installed the plugin, where can I find the Yoast JSON LD Schema.org data?<\/h3><\/dt>\n<dd><p>For each post\/page\/... you can find an array of JSON LD data in that object under <code>yoast_json_ld<\/code>.<\/p><\/dd>\n<dt id='i%20have%20created%20a%20custom%20post%20type%2C%20will%20the%20plugin%20add%20the%20meta%20tags%20to%20that%20post%20type%3F'><h3>I have created a custom post type, will the plugin add the meta tags to that post type?<\/h3><\/dt>\n<dd><p>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 <code>rest_prepare_POSTTYPE<\/code> filter.<\/p><\/dd>\n<dt id='can%20i%20add%20my%20own%20meta%20tags%3F'><h3>Can I add my own meta tags?<\/h3><\/dt>\n<dd><p>Yes you can! Use the hook <code>wp_rest_yoast_meta\/filter_yoast_meta<\/code> like this:<\/p>\n\n<pre><code>\/**\n * Add a custom meta tag.\n *\/\nfunction wpym_add_custom_meta_tag( $yoast_meta ) {\n    $yoast_meta[] = array(\n        'property' =&gt; 'og:type',\n        'content' =&gt; 'article'\n    );\n    return $yoast_meta;\n}\nadd_filter( 'wp_rest_yoast_meta\/filter_yoast_meta', 'wpym_add_custom_meta_tag', 10, 1);\n<\/code><\/pre><\/dd>\n<dt id='i%20have%20the%20yoast%20seo%20premium%20plugin%20installed%2C%20will%20it%20work%3F'><h3>I have the Yoast SEO Premium plugin installed, will it work?<\/h3><\/dt>\n<dd><p>Yes this plugin supports both the free and the premium version of Yoast SEO. Please keep in mind that the free version of Yoast SEO does not allow you to specify redirects, so the redirects endpoint will return an empty set.<\/p><\/dd>\n<dt id='i%20have%20set%20the%20homepage%20to%20display%20my%20latest%20posts%2C%20how%20do%20i%20get%20the%20yoast%20meta%20for%20the%20homepage%3F'><h3>I have set the homepage to display my latest posts, how do I get the Yoast meta for the homepage?<\/h3><\/dt>\n<dd><p>This plugin adds a custom endpoint (<code>\/wp-rest-yoast-meta\/v1\/home<\/code>) to retrieve the Yoast meta for the homepage.<\/p><\/dd>\n<dt id='i%20don%27t%20want%20the%20yoast%20meta%20to%20be%20applied%20to%20post%20type%20x%2C%20can%20i%20stop%20it%20from%20being%20added%3F'><h3>I don't want the Yoast Meta to be applied to post type X, can I stop it from being added?<\/h3><\/dt>\n<dd><p>Yes you can! Use the hook <code>wp_rest_yoast_meta\/filter_post_types<\/code> like this:<\/p>\n\n<pre><code>\/**\n * Remove Yoast Meta from the page post type\n *\/\nfunction wpym_remove_post_type( $post_types ) {\n    foreach ( $post_types as $key =&gt; $post_type ) {\n        if ( 'page' === $post_type-&gt;name ) {\n            unset( $post_types[ $key ] );\n        }\n    }\n\n    return $post_types;\n}\n\nadd_filter( 'wp_rest_yoast_meta\/filter_post_types', 'wpym_remove_post_type', 10, 1 );\n<\/code><\/pre><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2021.1.2<\/h4>\n\n<p>Release Date: July 1st, 2021<\/p>\n\n<p>Bugfix: The yoast_title wasn't set correctly for consecutive posts in an overview request.<\/p>\n\n<h4>2021.1.1<\/h4>\n\n<p>Release Date: April 20th, 2021<\/p>\n\n<p>Bugfix: As of WordPress 5.7.0 the robots meta doesn't come from Yoast SEO, but from WP Core.\nBugfix: The yoast meta doesn't include the  tag anymore, retrieve it differently.<\/p>\n\n<h4>2021.1.0<\/h4>\n\n<p>Release Date: January 7th, 2021<\/p>\n\n<p>Bugfix: Do not call deprecated wpseo_frontend_head_init function.<\/p>\n\n<h4>2020.2.2<\/h4>\n\n<p>Release Date: September 7th, 2020<\/p>\n\n<p>Bugfix: permission_callback notice as of WordPress 5.5.<\/p>\n\n<h4>2020.2.1<\/h4>\n\n<p>Release Date: June 8th, 2020<\/p>\n\n<p>Bugfix: Minor fix to the redirects endpoint.<\/p>\n\n<h4>2020.2.0<\/h4>\n\n<p>Release Date: April 30th, 2020<\/p>\n\n<p>Bugfix: Added support for Yaost SEO 14.0, which has done an extensive rebuild of code.<\/p>\n\n<h4>2020.1.0<\/h4>\n\n<p>Release Date: January 16th, 2020<\/p>\n\n<p>Bugfix: Fix for custom post types that are registered later in the initialisation process.<\/p>\n\n<h4>2019.5.3<\/h4>\n\n<p>Release Date: December 12th, 2019<\/p>\n\n<p>Bugfix: Fix notice.\nBugfix: Proper escaping of special characters.<\/p>\n\n<h4>2019.5.2<\/h4>\n\n<p>Release Date: November 22nd, 2019<\/p>\n\n<p>Bugfix: Check for at least Yoast SEO 11.* for specific functionality.\nFeature: Added seperate yoast_title attribute.<\/p>\n\n<h4>2019.5.1<\/h4>\n\n<p>Release Date: November 7th, 2019<\/p>\n\n<p>Feature: Added filter to be able to remove yoast meta from post types.\nBugfix: Fix multiplication of json-ld data.\nBugfix: Make sure Twitter meta image displays correct image.\nBugfix: Fix homepage endpoint not updating.<\/p>\n\n<h4>2019.5.0<\/h4>\n\n<p>Release Date: October 29th, 2019<\/p>\n\n<p>Feature: Added custom endpoint for retrieving homepage Yoast meta.<\/p>\n\n<h4>2019.4.2<\/h4>\n\n<p>Release Date: October 20th, 2019<\/p>\n\n<p>Bugfix: Transients shouldn't be set without expiration.<\/p>\n\n<h4>2019.4.1<\/h4>\n\n<p>Release Date: October 18th, 2019<\/p>\n\n<p>Bugfix: fix inconsistency between DOMDocument and simplexml in parsing json ld data.<\/p>\n\n<h4>2019.4.0<\/h4>\n\n<p>Release Date: October 17th, 2019<\/p>\n\n<p>Feature: Added Yoast SEO's JSON LD Schema.org data to the WP REST API.<\/p>\n\n<h4>2019.3.0<\/h4>\n\n<p>Release Date: October 15th, 2019<\/p>\n\n<p>Bugfix: Improved HTML parsing using DOMDocument.<\/p>\n\n<h4>2019.2.1<\/h4>\n\n<p>Release Date: June 27th, 2019<\/p>\n\n<p>Bugfix: Yoast meta wasn't regenerated correctly after a post update.<\/p>\n\n<h4>2019.2.0<\/h4>\n\n<p>Release Date: June 16th, 2019<\/p>\n\n<p>Improvement: Meet WordPress Coding Standards.\nBugfix: Better check if Yoast SEO (Premium) is installed and activated.<\/p>\n\n<h4>2019.1.0<\/h4>\n\n<p>Release Date: March 6th, 2019<\/p>\n\n<p>First public version.<\/p>","raw_excerpt":"Adds meta tags as generated by Yoast SEO to the WP REST API. And adds a custom endpoint to retrieve all redirects as they are set in Yoast SEO Premium &hellip;","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/98847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=98847"}],"author":[{"embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/acato"}],"wp:attachment":[{"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=98847"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=98847"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=98847"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=98847"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=98847"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/azb.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=98847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}