"Focus keyphrase" and "SEO title" is not available as variable of Surfaces API

This issue has been tracked since 2021-10-19.

Cannot retrieve all Yoast information with Surfaces API

At least the following attributes are missing from the possible results

  • Focus keyphrase
  • SEO title

Add these fields to available variables

The simplest solution is to to add

  • focus_keyphrase
  • seo_title

The importance to be consistent

It's important to offer a consistent interface with your data, so there will be no need to add some plugins to retrieve few fields.

Actual documented Variables

from https://developer.yoast.com/customization/apis/surfaces-api

VariableTypeDescription
canonicalstringThe canonical URL for the current page.
descriptionstringThe meta description for the current page, if set.
titlestringThe SEO title for the current page.
idstringThe requested object ID.
site_namestringThe site name from the Yoast SEO settings.
wordpress_site_namestringThe site name from the WordPress settings.
site_urlstringThe main URL for the site.
company_namestringThe company name from the Knowledge Graph settings.
company_logo_idintThe attachment ID for the company logo.
site_user_idintIf the site represents a 'person', this is the ID of the accompanying user profile.
site_representsstringWhether the site represents a 'person' or a 'company'.
site_represents_referencearrayfalse
breadcrumbs_enabledboolWhether breadcrumbs are enabled or not.
schema_page_typestringThe Schema page type.
main_schema_idstringSchema ID that points to the main Schema thing on the page, usually the webpage or article Schema piece.
page_typestringThe Schema page type.
meta_descriptionstringThe meta description for the current page, if set.
robotsarrayAn array of the robots values set for the current page.
googlebotarrayThe meta robots values we specifically output for Googlebot on this page.
rel_nextstringThe next page in the series, if any.
rel_prevstringThe previous page in the series, if any.
open_graph_enabledboolWhether OpenGraph is enabled on this site.
open_graph_publisherstringThe OpenGraph publisher reference.
open_graph_typestringThe og:type.
open_graph_titlestringThe og:title.
open_graph_descriptionstringThe og:description.
open_graph_imagesarrayThe array of images we have for this page.
open_graph_urlstringThe og:url.
open_graph_site_namestringThe og:site_name.
open_graph_article_publisherstringThe article:publisher value.
open_graph_article_authorstringThe article:author value.
open_graph_article_published_timestringThe article:published_time value.
open_graph_article_modified_timestringThe article:modified_time value.
open_graph_localestringThe og:locale for the current page.
schemaarrayThe entire Schema array for the current page.
twitter_cardstringThe Twitter card type for the current page.
twitter_titlestringThe Twitter card title for the current page.
twitter_descriptionstringThe Twitter card description for the current page.
twitter_imagestringThe Twitter card image for the current page.
twitter_creatorstringThe Twitter card author for the current page.
twitter_sitestringThe Twitter card site reference for the current page.
sourcearrayThe source object for most of this page data.
breadcrumbsarrayThe breadcrumbs array for the current page.
estimated_reading_time_minutesintThe estimated reading time in minutes for the content.
Djennez wrote this answer on 2021-10-19

The SEO title is already in the table that you provided as title. The keyphrase might be a good addition.

ivan-redooc wrote this answer on 2021-10-19

The SEO title is already in the table that you provided as title

Oh, I see, I belive title was the post_title that instead it can be retrieved in source:

YoastSEO()->meta->for_current_page()->source->post_title
More Details About Repo
Owner Name Yoast
Repo Name wordpress-seo
Full Name Yoast/wordpress-seo
Language JavaScript
Created Date 2012-11-16
Updated Date 2022-06-24
Star Count 1507
Watcher Count 145
Fork Count 802
Issue Count 786

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date