Skip Navigation

[Resolved] Yoast SEO %%cf_%% doesn't work with Custom Field

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to use Types custom field with Yoast SEO title meta template.

Solution:
Whenever you create any field using Types plugin, it prefix with 'wpcf-' so your field name should looks like wpcf-YOUR-FIELD-NAME'.

So the correct value for the post meta is:
%%cf_wpcf-rulenr%%

You can find proposed solution on the following link:
https://toolset.com/forums/topic/yoast-seo-%cf_-doesnt-work-with-custom-field/#post-396187

Relevant Documentation:
http://kb.yoast.com/article/146-yoast-wordpress-seo-titles-metas-template-variables

This support ticket is created 6 years, 3 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.

This topic contains 2 replies, has 2 voices.

Last updated by stefanS-7 6 years, 3 months ago.

Assigned support staff: Minesh.

Author
Posts
#396079
Bildschirmfoto 2016-05-08 um 12.00.08.png

Hi support,

I am trying to: Use the %%cf_<custom-field-name>%% Variables within the Yoast SEO plugin. See here: hidden link

With WP Types, I created a "Rule Number" numeric field with "rulenr" as slug, so I tried:
- %%cf_rulenr%%
- %%rulenr%%
- %%cf_wpcf-rulenr%%
- %%cf_wpcf[rulenr]%%

I expected to see the Rule Number show up in the Yoast SEO title. Instead, I only got the string I typed ("%%cf_rulenr%%") without replacement by the Rule Number value.

Best,
Stefan

#396187

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As per my understanding the correct value for the post meta is:

 %%cf_wpcf-rulenr%%

As when you create any field using Types plugin, it prefix with 'wpcf-YOUR-FIELD-NAME'.

I see the note that explains - to check whatever fields are available you should check with "Post types" tab:

NOTE: Below you will find only a sampling of the available variables. Please check the HELP tab in the top right corner of your WordPress admin screen in your Titles & Metas section for the complete list available to your site. You'll find it here:

hidden link

Could you please check where "wpcf-rulenr" field name is available under which tab?

#396592

Haaaa, you are great! The thing is, it does not preview. Setting %%cf_wpcf-rulenr%% globally (!) won't give me a preview - but it works.

Thank you! Awesome support! <3

(But by the way, I have the latest version of Types + Yoast SEO, but no "Help" button as in your screenshot.)