Support » Plugin: Yoast SEO » Including ACF checkboxes in Yoast = Array

  • Resolved James

    (@bonkerz)


    Hey
    I’m using the %%cf_FIELD%% style variables to include data in to the Yoast plugin for my pages. This works on normal text strings, but when I use it for checkbox data, it simple inserts “Array” in to my meta description.

    Is this a known issue with compatibility and any workaround you can advise?

    Thanks

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    Hmm. We are not sure if this is a bug or feature request to make Yoast work with checkebox data. We would like some more information.

    1. Can you confirm you are using the most recent Yoast SEO, v11.6? If you update, does the issue resolve?

    2. Are all your non-Yoast plugins and themes also updated?

    3. Sometimes even though it the snippet preview may show something unexpected, the right data gets parsed into the source code. If you were to look at the source code and locate the meta description, does the right content still appear? This guide explains more: https://kb.yoast.com/kb/view-page-source-site/

    4. Are you using ACF free or Pro?

    • This reply was modified 4 months, 2 weeks ago by Pcosta88.
    Plugin Support devnihil

    (@devnihil)

    We are going ahead and marking this issue as resolved due to inactivity. If you require any further assistance please create a new issue.

    It’s not a feature request per se, as I believe I could insert ACF fields in to Yoast as variables?

    1. Latest Yoast in use

    2. Everything updated.

    4. ACF Pro

    3. The meta description displays “Array”

    Here is how the ACF is setup:

    ACF Field name is tyre_key_features
    Field type = checkboxes
    There are 5 checkbox options.
    Return value = value

    In the snippet, I am using %%cf_tyre_key_features%%

    It returns “Array” printed in the meta description.

    Plugin Support Md Mazedul Islam Khan

    (@mazedulislamkhan)

    Yoast SEO supposes to work with the ACF fields. So, can you please share a screenshot in which you highlight the array you’re seeing so that we can take a look at it?

    James

    (@bonkerz)

    I’m not sure that showing you the word Array written in a meta description is going to help anything. All the information is above. Don’t worry, it’s a bug or it’s just not working as there are multiple checkboxes.

    Plugin Support Pcosta88

    (@pcosta88)

    Hi,

    To clarify you have checkboxes set-up with ACF Pro on a post or page. You are then trying to use a template variable: %%cf_tyre_key_features%% to output it into the meta description. But the snippet preview is showing: Array? Or is the word Array being shown in the source code?

    If you are not sure, we ask that you please verify that in the source code of the post/page that the data IS or IS NOT being outputted? This guide explains more: https://kb.yoast.com/kb/view-page-source-site/.

    We ask as sometimes the snippet preview shows one thing but the source code shows something else.

    James

    (@bonkerz)

    Yes “Array” is printed in the actual HTML meta description. As in the actual page. The source code. The real actual HTML of the page I’m on. The meta description.

    Plugin Support amboutwe

    (@amboutwe)

    The %%cf_ option works for custom fields that contain a single entry. When they contain an array, it will output array because the variable cannot look inside the array. To retrieve the information within the array, custom code must be used instead of the %%cf_ variable.

    You or your developer may want to add your own template variables using the wpseo_register_extra_replacements filter in your functions.php file. An example of how to use the filter can be viewed here.

    Plugin Support jerparx

    (@jerparx)

    Closed. No further questions.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.