Skip Navigation

[Resolved] Trying to add post relationship into Yoast SEO title

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1210903

I have artist posts and record release posts. There is a relationship established. When looking at a record by an artist I want the seo title to say "Record Title by Artist Name".

I have tried this in Yoast:
%%[wpv-post-title item="@artist-release.parent"]%% . to no avil.

Example here:
hidden link

Thanks

#1211360

Yoast SEO does not accept 3rd-party shortcodes in their template variables, but they do allow you to create your own custom template variables with PHP. Their documentation is here: https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/

There is an example of a custom variable here:
https://gist.github.com/amboutwe/550c10ede7d065d9264930f5480ca748#file-yoast_seo_title_custom-variable-php

We offer the post relationships API, which helps you access information from related posts:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/

And another ticket here in the forum with another example:
https://toolset.com/forums/topic/meta-descriptions-excerpts-from-views-content/#post-1128477

If you need professional assistance with this customization, you may be able to connect with an independent developer in our contractors portal: https://toolset.com/contractors