• Hi,

    I used Advanced Custom Field plugin to create a field named “place_address”

    in PHP I can get its value using below code:

    $place_address= get_field( “place_address”, $post->ID );

    I want to add place address to the Meta Description of Yoast and I have tried to use Yoast shortcode a few times but these below ways that I tried didn’t work for me:

    %%cf_<place_name>%%
    %%cf_place_name%%
    %%cf_<acf place_name>%%
    %%acf place_name%%

    Can someone help me to find out a way to do this?

    ***I’ve posted this question in SEO by Yoast forum but it seems that they don’t provide support to users of free version. So I re-post here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dzung

    (@bluesharp)

    Been searching for this a few days, after posting this I searched and founder new way for this. anyone wants to do this can do it like this: Tested

    Put these code in your functions.php and start customize
    /*
    Yoast SEO Meta Description Hook
    */
    function custom_seo_title( $site_title ) {
    return “Custom title”;
    }
    function custom_seo_description( $site_description ) {
    return “Custom description!”;
    }
    add_filter( ‘wpseo_title’, ‘custom_seo_title’, 10, 1 );
    add_filter( ‘wpseo_metadesc’, ‘custom_seo_description’, 10, 1 );
    /*End Yoast*/

    does it help with this problem? (custom field just shown in frontend but not in the snippet editor?) https://i.imgur.com/w8CnsLE.png

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How can I use advanced-custom-fields field in SEO by Yoast Meta Description?’ is closed to new replies.