• Resolved levdlevd

    (@levdlevd)


    Hello,

    Can i make custom text showing up as meta description with Yoast SEO?

    Im placing text in posts like this in php:

    $post[‘post_content’] .= ‘<p style=”text-align: left;”>Custom Text: ‘ . $post[‘custom_fields’][‘customtext’] .'</p>’;

    I tried making a metadescription from the text like this with yoast SEO:

    $post[‘post_content’] .= ‘<customfield><p style=”text-align: left;”>Custom Text: ‘ . $post[‘custom_fields’][‘customtext’] .'</p></customfield>’;

    meta description: %%cf_<customfield>%%

    and like this:

    $post[‘post_content’] .= ‘<label><p style=”text-align: left;”>Custom Text: ‘ . $post[‘custom_fields’][‘customtext’] .'</p></label>’;

    meta description: %%pt_single%%

    But this isnt working so i guess im doing it wrong.
    Any ideas?

    Thanks,

    levd

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter levdlevd

    (@levdlevd)

    Anyone?

    Plugin Support amboutwe

    (@amboutwe)

    The most common cause for this to not work is having the wrong custom field name or leaving the < and > characters. The correct custom field names can be found using the steps here. Once you have the custom field name, you will replace <custom-field-name>. If my custom field was called myfield, the custom variable would be %%cf_myfield%%.

    Plugin Support amboutwe

    (@amboutwe)

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

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

    Thanks for understanding!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘custom text as meta description’ is closed to new replies.