Pods Advance Content Type (aka Pods ACT) is out of the box solution to create custom types outside the usual WordPress’s posts tables including their own ready to use administration pages and user capabilities management.
However, this advance solution comes with a lack of poor integration with the most popular SEO plugin “Yoast” in terms of generating the right title & meta tags which search engines use to rank your pages. After a lot of digging and searching over the internet, I found the best way is to hack Yoast plugin and force it to understand the custom type you just created.
The root of the problem
To generate the right title and meta tags Yoast uses a class called
WPSEO_OpenGraph which you can find it on
wp-content/plugins/wordpress-seo/frontend/class-opengraph.php. This class seems to be hooked with the wp_head action and it uses WP_Query to read the information it needs.
On the other hand, the best way to create a landing page for Pods ACT is to use Pods Pages, which is totally different than WordPress pages. Pod Pages have content, yes, and they do have titles, but their use really becomes apparent when you’re looking to quickly create URLs on your site and point them to a Page Template within your Theme. As an example, if you used Pods ACT to create a custom type representing a resume, you may use Pods Pages to create a unified URL for all the resumes like YOUR_WEBSITE_DOMAIN/resume/permalink. Keep in mind that Pods Pages & ACT use their own sets of queries, not the WP_Query. That’s what makes Yoast class “WPSEO_OpenGraph ” not able to read the content of these pages and display it.
The best way to work around WP_Query issue is to inherit WPSEO_OpenGraph and rewrite its functions to read from your pods rather than WP_Query. This way you can feed the metadata with whatever data you want. Moreover, you have to create an instance for the class you just create before you call wp_header in your template page.
An Easier Solution
To make this easier for you, we already write the code for this class which could be used with any Pods Page & ACT you have and we wrapped in a plugin (Integrate Pods ACT with Yoast SEO). All that you have to do is install the plugin and directly use it in your page template.