getting error – cannot query “yoast_meta”
]]>Nvm
]]>This plugin is no more needed. Since Yoast SEO 16.7 all meta data are included in JSON format in yoast_head_json
key in REST API.
I have configured Yoast to include some custom fields in the title of a custom post type. The format goes like this:
%%title%% by %%cf_artist_name%% %%sep%% %%sitename%%
It is working fine within the small preview card that Yoast provides but since I’m using a VueJS frontend I would like to access this via the REST API. What the API return is this
yoast_title: "Ballast by — ArtWalk"
As you can see it is missing the custom fields (which are created with the latest version of ACF Pro).
I’m guessing this might be a problem with the plugin since the JSON returned has not been manipulated by other pieces of code.
Thanks for the plugin and for your time!
]]>With the latest release (which fixed the missing robots meta) there are now two robot entries pulling through on the WP REST API. One in the first “yoast_meta” array position and another in the last position.
]]>Hi there,
The robots meta is not working in the latest version of this plugin + the latest version of Yoast SEO and WP. Is this known?
Thanks, and kind regards,
Gerben
]]>Is there any way to get Yoast’s data object for categories into the categories gateway of the API?
Thank you very much,
Tzahi.
The canonical link is also important for SEO things, so it would be great to extend parsed response with <link> tags.
Probably it could be easily achieved by extending the parser function with something like this.
$links = $dom->getElementsByTagName( 'link' );
$yoast_links = [];
foreach ( $links as $link ) {
if ( $link->hasAttributes() ) {
$yoast_link = [];
foreach ( $link->attributes as $attr ) {
// phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase
$yoast_link[ $attr->nodeName ] = esc_html( wp_strip_all_tags( stripslashes( $attr->nodeValue ), true ) );
}
$yoast_links[] = $yoast_link;
}
}
]]>
I’m able to get the yoast_meta and yoast_json data I need on the endpoints such as /wp-json/wp/v2/pages/{page_id}
However the Yoast_title is always null even thought these exist.
Any ideas?
hi, we are on a headless cms, (react) we keep trying to upgrade to 14 premium but keep getting all kinds of errors in reference to the schema changing, we have worked and worked trying to edit code to try and get yoast 14 to work, we got not support from the original developers of the react head and we are thinking we may need to disable the yoast functionality (integration) and perhaps find another solution. Is this plugin a possible solution??
]]>As of WordPress 5.5 your plugin begins to produce PHP notices for not providing a permissions_callback argument when registering your REST routes, just flagging this for your next scheduled release as it started producing notices when I run WP CLI commands.
]]>
Hi,
with this plugin, is it possible, when creating a post remotely through WP Rest API, to insert values in Yoast fields (like SEO Title and meta-description)?
]]>Hi, thanks for your plugin that seems very useful !
Currently, I’m trying to build a custom endpoint for my custom post types but I’m struggling quite a bit with your plugin. I would like, after using WP_Query, to iterate through the posts to add your yoast_meta field.
It works well when I use the usual /wp/v2/ with my custom post types but is it possible for custom endpoints ?
]]>I have yoast meta fields showing in rest api for custom post type – but not showing for custom taxonomy. how can i enable that??
]]>How does this plugin helps a site, any site.
Sorry for my silly question.
After plugin update, home: /wp-rest-yoast-meta/v1/home
Returns null:
{
"yoast_title": null,
"yoast_meta": null,
"yoast_json_ld": null
}
]]>
Hi there,
I’ve ran into an issue. On the new 14+ version of yoast the seo data is not returned after the page is updated.
I think it’s because the transients are being deleted on page update and the get_yoast_data() is returns NULL.
How can I regenerate that transient or get the data from Yoast SEO?
Thanks!
I.
Hi,
After updating Yoast to the latest 14.0 version, I can no longer edit articles using Gutenberg editor. When I try to edit one of the articles, I get a “Critical error” message.
I’m certain this is caused by an incompatibility issue between the new Yoast 14.0 version and the WP Rest Yoast Meta plugin, because disabling the latter fixes the issue.
When looking at PHP error logs, this is the output:
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /var/www/html/wp-includes/query.php:28
Stack trace:
#0 /var/www/html/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(589): get_query_var('paged')
#1 /var/www/html/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(940): WPSEO_Replace_Vars->determine_pagenumbering('max')
#2 /var/www/html/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(257): WPSEO_Replace_Vars->retrieve_page()
#3 /var/www/html/wp-content/plugins/wordpress-seo/inc/class-wpseo-replace-vars.php(178): WPSEO_Replace_Vars->set_up_replacements(Array, Array)
#4 /var/www/html/wp-content/plugins/wordpress-seo/src/presenters/abstract-indexable-presenter.php(57): WPSEO_Replace_Vars->replace('%%sitename%% %%...', Array)
#5 /var/www/html/wp-content/plugins/wordpress-seo/src/presenters/title-presenter.php(37): Yoast\\WP\\SEO\\Presenters\\Abstract_Indexable_Presenter->replace_vars('%%sitename%% %%...')
#6 /var/www/html/wp-content/plugins/wordpress-seo/src/ in /var/www/html/wp-includes/query.php on line 28, referer: https://xxxxxxxxx/wp-admin/edit.php
Thanks!
]]>You can check in url.
Data in “link” field is correct and in yoast_meta isn’t.
As you see, I use it for headless integration. It work good but this cannot be used in that form without rewrite ;/
Maybe add HOOK to support multiple domain as well?
Thanks for great work !!!
Hi,
Your pluging sounds interesting but I’m not able to use it for the moment.
Indeed, I’m getting the following error:
GraphQLError: Syntax Error: Unexpected Name "WordPressPost_YoastJsonLd_"
I’m using Gridsome 0.7.12 and WordPress 5.3.2
Thanks
]]>With this plugin, can I add tags ‘description’ to the post with REST API? For the title tag I add the following construction {‘title’: ‘Post title example’} in POST request. Is there something similar for the description tag?
]]>Hello,
I am not familiar with the WP REST API or how it works.
I would like to make changes to Yoast’s Schema that was placed on my site. Something besides Schema-Webpage. Want to change a few things, adding my own code for Schema-LocalBusiness, as well as Schema-FAQ, Schema-Service, or Schema-Article.
Using a Header Footer Plugin to apply the new code.
Will this Plugin help with that. How do I do this? Could you possibly help in anyway?
Thank you
]]>Would be fantastic with woocommerce support for this. Is this a feature you would add in a near future?
]]>Hello, thank you for your work on this plugin, it’s exactly what I need. However, I am having some issues getting it working, this error is appearing:
Fatal error: Uncaught Error: Call to undefined function WP_Rest_Yoast_Meta_Plugin\Frontend\simplexml_load_string() in /home/www.somewebsite.com/htdocs/blog/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php:382 Stack trace: #0 /home/www.somewebsite.com/htdocs/blog/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(326): WP_Rest_Yoast_Meta_Plugin\Frontend\Frontend->parse_using_simplexml('\n<!-- This site...') #1 /home/www.somewebsite.com/htdocs/blog/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(255): WP_Rest_Yoast_Meta_Plugin\Frontend\Frontend->parse('\n<!-- This site...') #2 /home/www.somewebsite.com/htdocs/blog/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(113): WP_Rest_Yoast_Meta_Plugin\Frontend\Frontend->get_yoast_data(Object(WP_Post)) #3 /home/www.somewebsite.com/htdocs/blog/wp-includes/class-wp-hook.php(288): WP_Rest_Yoast_Meta_Plugin\Frontend\Frontend->rest_add_yoast(Object(WP_REST_Response), Object(WP_Post), Obj in /home/www.somewebsite.com/htdocs/blog/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php on line 382
Any help would be great!
Thank you!
]]>Hi,
Thanks for your work on this plugin, it’s been working mostly fine for me but for some reason the yoast_*
fields are not coming through in my custom post types, it does work fine for pages and regular posts.
Here’s how I’ve registered it in case it helps:
function portfolio_post_type() {
$labels = [
'name' => 'Portfolio Items',
'singular_name' => 'Portfolio Item',
'menu_name' => 'Portfolio',
'name_admin_bar' => 'Portfolio',
'archives' => 'Item Archives',
'attributes' => 'Item Attributes',
'parent_item_colon' => 'Parent Item:',
'all_items' => 'All Items',
'add_new_item' => 'Add New Item',
'add_new' => 'Add New',
'new_item' => 'New Item',
'edit_item' => 'Edit Item',
'update_item' => 'Update Item',
'view_item' => 'View Item',
'view_items' => 'View Items',
'search_items' => 'Search Item',
'not_found' => 'Not found',
'not_found_in_trash' => 'Not found in Trash',
'featured_image' => 'Featured Image',
'set_featured_image' => 'Set featured image',
'remove_featured_image' => 'Remove featured image',
'use_featured_image' => 'Use as featured image',
'insert_into_item' => 'Insert into item',
'uploaded_to_this_item' => 'Uploaded to this item',
'items_list' => 'Items list',
'items_list_navigation' => 'Items list navigation',
'filter_items_list' => 'Filter items list',
];
$args = [
'label' => 'Portfolio Item',
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-portfolio',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
'show_in_rest' => true,
];
register_post_type( 'portfolio', $args );
}
add_action( 'init', 'portfolio_post_type' );
I’m using WP 5.3.1 and the plugin version 2019.5.3, can you advise what to do?
Thanks.
]]>I have a WPMU environment and I have network enabled the plugin and inserted some social media links into my user:
https://ssws.ca/wp-json/wp/v2/users/1
though the yoast_json_ld
dataset is only available via the post API, such as:
https://ssws.ca/wp-json/wp/v2/posts/1705
Is there a specific reason why they don’t appear in the user endpoint itself?
If a user has no posts I can not retrieve its social links via API, only through a PHP function in a template.
Thanks in advance for the clarification or the solution if any at hand.
Giorgio
[Thu Nov 28 08:39:48.804112 2019] [:error] [pid 32534] [client 123.63.22.145:53082] PHP Fatal error: Uncaught Error: Call to undefined function WP_Rest_Yoast_Meta_Plugin\\Frontend\\mb_convert_encoding() in /var/www/html/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php:346\nStack trace:\n#0 /var/www/html/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(327): WP_Rest_Yoast_Meta_Plugin\\Frontend\\Frontend->parse_using_domdocument(‘\\n<!– This site…’)\n#1 /var/www/html/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(258): WP_Rest_Yoast_Meta_Plugin\\Frontend\\Frontend->parse(‘\\n<!– This site…’)\n#2 /var/www/html/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php(113): WP_Rest_Yoast_Meta_Plugin\\Frontend\\Frontend->get_yoast_data(Object(WP_Post))\n#3 /var/www/html/wp-includes/class-wp-hook.php(288): WP_Rest_Yoast_Meta_Plugin\\Frontend\\Frontend->rest_add_yoast(Object(WP_REST_Response), Object(WP_Post), Object(WP_REST_Request))\n#4 /var/www/html/wp-includes/plugin.php(206): WP_Hook->apply_filters(Object(WP_REST_Response), Array)\n#5 /var/www/html/wp-includes/re in /var/www/html/wp-content/plugins/wp-rest-yoast-meta/frontend/class-frontend.php on line 346, referer: https://dev.jetking.com/
]]>Hi,
Thanks for the plugin!
I am getting Yoast data back for all of the Posts and CPTs, but nothing from categories (/wp-json/wp/v2/categories)
or Custom Categories /wp-json/wp/v2/project-categories
Any ideas what the issue might be
I am using Yoast 12.6.1 nd WP 5.2.1
Thanks In Advance
]]>My response looks like this
`
+”yoast_meta”: array:11 [▼
0 => {#600 ▼
+”name”: “description”
+”content”: “Shop page meta description”
}
1 => {#598 ▼
+”name”: “robots”
+”content”: “noindex,follow”
}
2 => {#612 ▼
+”property”: “og:locale”
+”content”: “en_US”
}
3 => {#605 ▼
+”property”: “og:type”
+”content”: “article”
}
4 => {#596 ▼
+”property”: “og:title”
+”content”: “Shop – Storename”
}
5 => {#614 ▼
+”property”: “og:description”
+”content”: “Shop page meta description”
}
6 => {#615 ▼
+”property”: “og:url”
+”content”: “https://myurl.com/shop”
}
7 => {#616 ▼
+”property”: “og:site_name”
+”content”: “Sitename”
}
8 => {#617 ▼
+”name”: “twitter:card”
+”content”: “summary_large_image”
}
9 => {#618 ▼
+”name”: “twitter:description”
+”content”: “Shop page meta description”
}
10 => {#619 ▼
+”name”: “twitter:title”
+”content”: “Shop – Storename”
}
]
`
as you can see the object/array names are inconstant. That means in a foreach loop you have to check if the yoast_meta has “name” or “property” on each.
To speed things up is there a way to make the array more associative like
`
+”yoast_meta”: array:11 [▼
“description” : “Shop page meta description”,
“robots” : “noindex,follow”,
“og:locale”: “en_US”,
“og:type”: “article”,
“og:title”: “Shop – Storename”,
“og:description”: “Shop page meta description”,
“og:url”: “https://myurl.com/shop”
“og:site_name”: “Sitename”
“twitter:card”: “summary_large_image”
“twitter:description”: “Shop page meta description”
“twitter:title”: “Shop – Storename”
]
`
Thanks in advance.
When I first installed this plugin I was able to use the yoast_meta graphql category with ‘name’, ‘property’ and ‘content’ as the available sub categories. For some reason now the ‘content’ portion is showing up with sub categories. There is also nested yoast_meta tags. One inside of the other. All I want is the name, property, and content. Screenshot link below. Any help is appreciated.
]]>