Yoast / Yoast/wordpress-seo

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

Open
#17,527 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

featurerequest
Dominant language
JavaScript
Stars
2k
Forks
975
Avg merge
3d 13h
Merged PRs (30d)
36

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Surfaces API implementation and its documented variable list, then trace how page metadata is exposed through the API. Done means focus_keyphrase and seo_title are available in API results and included in the documented variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
wordpress
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.