Due to the Yoast SEO indexable project using an entirely new namespaced Dependency Injection architecture, we’ve had to change some of our Schema API. All your existing integrations still work as we’ve made them backwards compatible, but we ask that you please update to the new code when you can. In this post I will explain the changes we made.
Overall, there are four important changes. All your old code still works, as we’ve added full backwards compatibility. However, that code will start throwing deprecation notices. The good news is, these changes are fairly simple and will make life easier in the long run.
If you were implementing your own graph pieces and adding them with the , you probably had something like this:
class YoastCon implements \WPSEO_Graph_Piece {
You should replace it with:
use \Yoast\WP\SEO\Generators\Schema\Abstract_Schema_Piece;
class YoastCon extends Abstract_Schema_Piece {
This Abstract_Schema_Piece is an abstract, and not an interface, because it has two public properties: $context and $helpers. These are filled magically and can be used to obtain important data.
WPSEO_Schema_IDs becomes Schema_IDs
The Schema ID helper class has moved, it’s now called Schema_IDs, full namespace Yoast\WP\SEO\Config\Schema_IDs. This is simply a case of importing that class and then search & replacing all your code, so for instance  WPSEO_Schema_IDs::PERSON_LOGO_HASH becomes Schema_IDs::PERSON_LOGO_HASH.
The context, that is now of class Meta_Tags_Context is automatically exposed under $this->context. All the helpers you could need are under $this->helpers. As you can see, generating an image can be done using the  Yoast\WP\SEO\Helpers\Schema\Image_Helper class, which is automatically available under  $this->helpers->schema->image. You’ll find that if you use a modern IDE like PHPStorm or Visual Studio Code, all of these auto expand for lots of coding convenience.
Note that the Schema ID for the image has become a parameter on the function call instead of on the class constructor.
Classes have moved
We’ve moved classes, according to the table below, and the signature of some of the functions within them have slightly changed, nine times out of ten to get a Meta_Tags_Context parameter.
If you were, for instance, extending WPSEO_Person, that is now called Yoast\WP\SEO\Generators\Schema\Person. Extending Person is as simple as this:
use Yoast\WP\SEO\Generators\Schema\Person;
/**
* Class Team_Member
*/
class Team_Member extends Person {
The old versus new class names:
Old class name
New class name
WPSEO_Graph_Piece
Now an abstract class instead of an interface: Abstract_Schema_Piece
WPSEO_Schema_Article
Article
WPSEO_Schema_Author
Author
WPSEO_Schema_Breadcrumb
Breadcrumb
WPSEO_Schema_Context
Meta_Tags_Context automatically available under $this->context when you extend Abstract_Schema_Piece
Joost is an internet entrepreneur and the founder of Yoast. He has a long history in WordPress and digital marketing. On our blog, he has written a lot about SEO in general, technical SEO and important topics related to SEO.
October 27 - 28, 2025
Team Yoast is Attending, Speaking at State of Search 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 (1)
Janz NordmanApr. 08, 2020
You are doing great work. Any plans to support CreativeWork schema? As far as I see there’s currently structured data for pages and CreativeWork can be one of the nominant. Best regards
You are doing great work. Any plans to support CreativeWork schema? As far as I see there’s currently structured data for pages and CreativeWork can be one of the nominant. Best regards