With Yoast SEO 14.0 we’re introducing lots of new goodies. One of them is a Yoast SEO REST API endpoint that’ll give you all the metadata you need for a specific URL. This will make it very easy for headless WordPress sites to use Yoast SEO for all their SEO meta output.
You’ll receive a normale WP REST API response, with an additional field: yoast_head. This additional field will contain a blob with all the necessary meta tags for that page. This works for the posts, pages, categories, tags and all custom post types and custom taxonomies.
For post type archives, when you query the types endpoint the meta is included there, also on the yoast_head field. If it is not there, the post type does not have a post type archive enabled.
Yoast SEO REST API syntax
The syntax is very simple, you just GET to /wp-json/yoast/v1/get_head?url= with the proper URL, for example:
{
"head": "the complete, escaped, <head> output for Yoast SEO",
"status": 200,
}
The head contains the complete meta output for the page. This means the Yoast SEO REST API output contains everything:
The title
The meta description, if you have one
Robots meta tags
The canonical URL
Our Schema output
OpenGraph meta data
Twitter meta data
The API returns 404 for an existing page?
If the status is not200 but you’re certain the page exists, you’ll need to make sure your site is completely indexed. Just hitting save on the backend should save the post or page to the Indexables database. Note that Yoast SEO will return a head for other statuses too, so you can use the output on, for instance, 404 pages.
If you have a notice in your site’s admin about indexing your site: please run that index process if you intend to rely on this API.
I don’t want this API on my site!
You can easily disable this API by going to SEO – General – Features and disabling the feature toggle.
Headless WordPress and Yoast SEO
With this Yoast SEO REST API endpoint we hope to support those people building headless WordPress sites a lot better. But we’d love to hear from you if you’re currently building headless WordPress sites. Is this useful to you? Would you like to see changes? Let us know in the comments!
November 05 - 06, 2025
Team Yoast is Attending, Organizing, Speaking at Cloudfest USA 2025! Click through to see who will be there, what we will do, and more!
See where you can find us next »
3 November 2025
Learn how to start your SEO journey the right way with our free webinar. Perfect for beginners seeking to improve website performance 🚀 .
All Yoast SEO Webinars
Discussion (9)