PHPackages                             mupic/wp-api-yoast-meta - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mupic/wp-api-yoast-meta

ActiveLibrary[API Development](/categories/api)

mupic/wp-api-yoast-meta
=======================

2.2.0(7y ago)029PHP

Since Mar 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/mupic/wp-api-yoast-meta)[ Packagist](https://packagist.org/packages/mupic/wp-api-yoast-meta)[ RSS](/packages/mupic-wp-api-yoast-meta/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (6)Used By (0)

Yoast to REST API v2
====================

[](#yoast-to-rest-api-v2)

Supports Yoast SEO &gt;= 11.0
=============================

[](#supports-yoast-seo--110)

Install
=======

[](#install)

```
composer require mupic/wp-api-yoast-meta

```

For use with the new [WP REST API](http://v2.wp-api.org/)

Returns Yoast post or page metadata in a normal post or page request. Stores the metadata in the `yoast_meta` field of the returned data.

Default constants
=================

[](#default-constants)

```
//GET params will take precedence over constants
define('YOAST_REST_META', false); //false - Disable automatic meta seo input. (Equivalent in get request: meta=false)
define('YOAST_REST_OG', false); //false - Disable automatic open graph input. (Equivalent in get request: opengraph=false)
define('YOAST_REST_TW', false); //false - Disable automatic meta twitter input. (Equivalent in get request: twitter=false)
define('YOAST_REST_BC', false); //true - Return json breadcrumbs. "html" - Return html generated breadcrumbs. (Equivalent in get request: breadcrumbs=false)
define('YOAST_REST_SCHEMA', false); //false - Disable automatic microdata input. (Equivalent in get request: schema=false)

define('YOAST_REST_ENABLE_EMBED', false); //false - Disable yoast in fields called from _embed=true. (Equivalent in get request: yoast_embed=false)

```

Examples
========

[](#examples)

```
//wp-json/wp/v2/posts/123?yoast_meta=true&opengraph=true&twitter=true&breadcrumbs=true&schema=true
{
	id: 123,
	...
	yoast:{
		breadcrumbs: {
			links: [
				0: {
					allow_html: true
					text: "Home"
					url: "http://example.com/"
				},
				1: {
					text: "News"
					url: "http://example.com/category/news/"
				},
				2: {
					text: "Title"
					url: "http://example.com/news/title/"
				}
			],
			separator: "»"
		},
		meta: {
			canonical: "http://example.com/news/title/"
			description: "Description"
			article:modified_time: "2019-04-01T16:22:10+00:00"
			article:published_time: "2019-01-10T13:05:30+00:00"
			article:section: "News"
			article:tag: ["Tag1", "Tag2"]
			og:description: "Description"
			og:image: "http://example.com/wp-content/uploads/2019/01/6JHYYbvoSuQ95ceGx8Oeg8zzAjg-550x309.jpg"
			og:image:height: "309"
			og:image:width: "550"
			og:locale: "en_US"
			og:site_name: "Site"
			og:title: "Title - site"
			og:type: "article"
			og:updated_time: "2019-04-01T16:22:10+00:00"
			og:url: "http://example.com/news/title/"
			title: "Title - site"
			twitter:card: "summary"
			twitter:description: "Description"
			twitter:image: "http://example.com/wp-content/uploads/2019/01/6JHYYbvoSuQ95ceGx8Oeg8zzAjg.jpg"
			twitter:title: "Title - site"
		},
		schema: "{"@context":"https://schema.org","@graph":[...]}" //all schemes
	}
}

```

```
//yoast_api/v1/home?yoast_meta=true&opengraph=true&twitter=true&breadcrumbs=true&schema=true
{
	breadcrumbs: {
		links: [
			0: {
				allow_html: true
				text: "Home"
				url: "http://example.com/"
			}
		],
		separator: "»"
	},
	meta: {
		canonical: "http://example.com/"
		description: "Description"
		og:description: "Description"
		og:locale: "en_US"
		og:site_name: "Site"
		og:title: "Title - site"
		og:type: "website"
		og:url: "http://example.com/"
		title: "Title - site"
		twitter:card: "summary"
		twitter:description: "Description"
		twitter:title: "Title - site"
	},
	schema: {
		organization: "{"@context":"https://schema.org","@type":"Organization","url":"http://example.com/","sameAs":[],"@id":"http://example.com/#organization","name":"My super company","logo":"http://example.com/wp-content/uploads/2019/02/7e55b905c43b67479065761d49f0dcb8-2.png"}",
		website: "{"@context":"https://schema.org","@type":"WebSite","@id":"http://example.com/#website","url":"http://example.com/","name":"SiteName","potentialAction":{"@type":"SearchAction","target":"http://example.com/?s={search_term_string}","query-input":"required name=search_term_string"}}"
	}
}

```

```
//wp-json/wp/v2/posts/123?yoast_meta=true&breadcrumbs=html
{
	id: 123,
	...
	yoast:{
		breadcrumbs: {
			html: "Home » News » Title"
		},
		meta: {...}
	}
}

```

Supports pages, posts, any *public* custom post types, categories, tags, any *show\_in\_rest* custom taxonomies

Currently fetching:

- `canonical`
- `description`
- `yoast_wpseo_title`
- `yoast_wpseo_metadesc`
- `yoast_wpseo_canonical`
- `article:modified_time`
- `article:published_time`
- `article:section`
- `article:tag`
- `og:description`
- `og:image`
- `og:image:height`
- `og:image:width`
- `og:locale`
- `og:site_name`
- `og:title`
- `og:type`
- `og:updated_time`
- `og:url`
- `title`
- `twitter:card`
- `twitter:description`
- `twitter:image`
- `twitter:title`

Currently updating:

- `yoast_wpseo_focuskw`
- `yoast_wpseo_title`
- `yoast_wpseo_metadesc`
- `yoast_wpseo_linkdex`
- `yoast_wpseo_metakeywords`
- `yoast_wpseo_meta-robots-noindex`
- `yoast_wpseo_meta-robots-nofollow`
- `yoast_wpseo_meta-robots-adv`
- `yoast_wpseo_canonical`
- `yoast_wpseo_redirect`
- `yoast_wpseo_opengraph-title`
- `yoast_wpseo_opengraph-description`
- `yoast_wpseo_opengraph-image`
- `yoast_wpseo_twitter-title`
- `yoast_wpseo_twitter-description`
- `yoast_wpseo_twitter-image`

Fork from

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 52% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~4 days

Total

5

Last Release

2580d ago

Major Versions

1.1.1 → 2.0.02019-04-06

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c30f1dfe16aeff549b90a8a3c123212f5538a1a4c015090c79a3a87813e760b?d=identicon)[mupic](/maintainers/mupic)

---

Top Contributors

[![ChazUK](https://avatars.githubusercontent.com/u/768108?v=4)](https://github.com/ChazUK "ChazUK (13 commits)")[![mupic](https://avatars.githubusercontent.com/u/15020351?v=4)](https://github.com/mupic "mupic (7 commits)")[![leup](https://avatars.githubusercontent.com/u/431119?v=4)](https://github.com/leup "leup (2 commits)")[![dokicro](https://avatars.githubusercontent.com/u/14295077?v=4)](https://github.com/dokicro "dokicro (1 commits)")[![phatsk](https://avatars.githubusercontent.com/u/990374?v=4)](https://github.com/phatsk "phatsk (1 commits)")[![Poliuk](https://avatars.githubusercontent.com/u/2798729?v=4)](https://github.com/Poliuk "Poliuk (1 commits)")

### Embed Badge

![Health badge](/badges/mupic-wp-api-yoast-meta/health.svg)

```
[![Health](https://phpackages.com/badges/mupic-wp-api-yoast-meta/health.svg)](https://phpackages.com/packages/mupic-wp-api-yoast-meta)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
