• Resolved algerpixel

    (@algerpixel)


    I want to use “show_seo_snippet” (an ACF custom field) to populate Yoast’s own Snippet field; and the “showkeyphrase” custom field to populate Yoast’s Key Phrase field.
    You can see how I would like to use them in the following screenshot – please note however that in this screenshot I still had to manually enter these values in the Yoast widget on this CPT edit page..

    ACF fields to Yoast fields

    I am also using an Elementor template (shown in the next screenshot) with the “Shows” CTP.
    I edited the template’s Editior page to use the following tokens ‘in the hope the tokens would place the two custom fields into the SEO fields shown above.
    However, this is not working.

    Tokens are not working.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Michael Ti?a

    (@mikes41720)

    If you are using custom fields, you may want to refer to this KB article in order to get the custom fields variable working in the snippet — https://kb.yoast.com/kb/yoast-wordpress-seo-titles-metas-template-variables/#custom-variables

    However, with regards to populating the focus keyphrase, you may want to consider inputting it manually, as it was intended.

    Plugin Support amboutwe

    (@amboutwe)

    This thread has been marked as resolved due to lack of activity.

    You’re always welcome to re-open this topic. Please read this post before open a new request.

    Thanks for understanding!

    Did you ever find the answer to this? I’m also very stuck trying to do this. I don’t understand how to get a pages variables and meta data into the filter function in functions.php

    • This reply was modified 5 years, 11 months ago by funianrun.
    Thread Starter algerpixel

    (@algerpixel)

    Not exactly.
    The only way I could set up a custom field for the brief description was to create a field to hold the data; and then I used Filemaker to build/structure a calculation field result that generates the data from other FM fields that hold the title and brief description. I then copy/pasted the value from the calc field in FM into the custom field.

    A lot of extra work, but it gets me what I wanted.
    I couldn’t find a way to do this entirely from ACF – not to say it is not possible.. But I couldn’t figure out how using ACF alone.

    @algerpixel
    I actually kinda figured it out after i wrote this, but for seo title tag only. Here is what I did:

    Turned on yoast SEo plugin. Then used this code:

    add_filter('wpseo_title', 'filter_product_wpseo_title');
    function filter_product_wpseo_title($title) {
        if(  is_singular( 'my_post_type') ) {	
            $title = get_field("title_tag");
            $title = $title . " | " . get_bloginfo("name");
        }
        return $title;
    }
    • This reply was modified 5 years, 11 months ago by funianrun.
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Using ACF fields in the site description’ is closed to new replies.