Support » Plugin: Yoast SEO » Debugging Custom Fields

  • WordPress version: 3.4.2
    WordPress SEO version: 1.3.0
    Types :

    I did this:
    Created the following meta template for a custom post type in the taxonomies section of Yoast
    Blah blach %%cf_city%% blah blah vlah

    I expected the plugin to do this:
    The plugin to replace the %%cf_city%% tag with the value of the city custom field.

    Instead it did this:
    The %%cf_city%% was simply left blank in the meta description, rendering on the page as
    Blah blach blah blah vlah

    Simply to ensure I wasn’t providing the wrong name, I have tried a large number of variations of cf_city, such as cf_wpcf-city, cf_City etc. I am hoping that I can be pointed down a path that could help me troubleshoot debug the issue.

Viewing 1 replies (of 1 total)
  • I was able to figure out the issue… Here’s how.

    1: Stopped worrying about Yoast and just took a look at the custom fields on the custom type… I verified the information using the following code snippet provided by Justin Tadlock ( ) a few years ago

    $custom_fields = get_post_custom();

    foreach ( $custom_fields as $field_key => $field_values ) {
    foreach ( $field_values as $key => $value )
    echo $field_key . ‘ – ‘ . $value . ‘

    2. The value I was looking for was returned and it was in the list of items I tried in the page meta description. Specifically %%cf_wpcf-city%% was the field that worked when placed on the taxonomy but not on the post specific meta description. I thought this was odd, because my understanding was that you could use Yoast tags anywhere. If anyone has any comments or insight why it would not work on the post specific meta description but does work in the title and meta taxonomies meta template for the Custom Type post type I’d appreciate it. Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Debugging Custom Fields’ is closed to new replies.