WordPress SEO - Titles & Meta - Types 1 - JSnowCreations

Fix Yoast’s WordPress SEO Title & Meta Variables with Types Custom Fields

If you are like me you insist on using Yoast’s WordPress SEO plugin to control you WordPress website or blog’s page titles and meta tag data via the “Titles & Meta” settings page found in the WordPress SEO. If you’re really like me then you are also too lazy to custom PHP code your WordPress theme to have custom post types, custom taxonomies, and/or custom fields so you instead use a plugin to quickly and easily make all the custom post types/taxonomies/fields for you, such as the “Types” WordPress plugin!

Yoast’s WordPress SEO plugin is a breeze to use even for beginners, and the Types plugin is also fairly easy to use for moderately experienced WordPress users. However, getting custom post types, custom taxonomies, and custom fields to work with the “Titles & Meta” variables within WordPress SEO’s settings can be tricky.

Allow me to clear up the minor issue I ran into with WordPress SEO’s Titles & Meta variables and Types custom fields.

If you look here or one of the many other WordPress SEO guides you will find many options to use on the Titles & Meta variables, but the three we are focusing on in this post are:

These three variables are used to input values from custom fields, taxonomies, and taxonomy descriptions into WordPress SEO Titles & Meta fields which then control SEO Meta Tags.

Custom taxonomies and taxonomy descriptions work just as you would think – replace “custom-tax-name” AND the surrounding “<” “>” brackets in the %%ct_…%% and %%ct_desc_…%% variables with your custom taxonomy slug.

Examples:

After using these variables correctly, your WordPress SEO Titles & Meta fields should correctly input custom taxonomy names and taxonomy descriptions into your site’s SEO meta tags!

However, the custom fields variable has a small issue with the Types plugin that might cause trouble for some.. It’s not even really an “issue”, just something many will overlook. Make sure to read below before you go searching “%%cf_%% not working with Types custom field” at Google!

The problem with WordPress SEO’s Titles & Meta variables and Types custom fields, and how to fix it!

WordPress SEO - Titles & Meta 1 - JSnowCreations
WordPress SEO – Titles & Meta 1 – JSnowCreations

Given how simple it is to get custom taxonomies and taxonomy descriptions made with the Types plugin working with Yoasts’s WordPress SEO Titles & Meta, you’d think getting custom fields from Types to work would be as simple as plugging the custom field’s slug into the %%cf_…%% variable such as %%cf_download-developer%%, right?

Wrong! The Types plugin, along with many other custom-field-creating plugins, adds a prefix to the beginning of custom field slugs and Types’ custom field slug happens to be “wpcf-“. So, in order to get custom fields created with the Types plugin to work with WordPress SEO’s Titles & Meta variables you must simply add the wpcf- prefix from Types to your Titles & Meta variables.

Examples:

After adding the extra prefix from Types to your custom field slugs entered in the Titles & Meta variables in WordPress SEO’s settings, your SEO meta tags should start correctly outputting custom field values! 😀

WordPress SEO - Titles & Meta - Types 1 - JSnowCreations
WordPress SEO – Titles & Meta – Types 1 – JSnowCreations

Yoast’s WordPress SEO’s Titles & Meta variables work great with custom fields made with the Types Plugin once you know what your doing!

I suppose it also helps if you find my post regarding the issue rather than blindly trying and getting things 99% correct like the guy here who just left in the “<" ">” brackets from WordPress SEO’s guide on Titles & Meta variables. Too bad the PAID support he got didn’t give him the easy, and correct, solution of just removing the brackets! 😮

Please, comment below with any questions of comments you may have about this post, or anything else regarding Yoast’s WordPress SEO plugin or Types!