custom field used as meta description

This topic contains 7 replies, has 4 voices, and was last updated by  Alex Rollin 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #535695

    Steffen
    Lifetime Member
    Post count: 48

    Hello,
    some time ago you set up a custom field for use as meta description

    https://wpgeodirectory.com/support/topic/custom-field-to-be-used-as-meta-description/

    I checked the google result page and found that it doesn’t work (anymore).

    Could you please check and let me know, if it needs to be modified.

    example:
    https://therapie-portal.de/orte/change-active-coaching-training-seminare-fuer-menschen/

    #535707

    Kor
    Moderator
    Post count: 16516

    Hi Steffen,

    Thanks for your post. You can refer to the SEO suggestions and recommendations here https://wpgeodirectory.com/docs-v2/faq/seo/ . Let us know if it helps.

    #535716

    Steffen
    Lifetime Member
    Post count: 48

    Hi,
    thank you for the link.

    I think I need 1. to deactivate yoast?

    Can I add a shortcode like this: %%title%% to output the text of a custom field in the meta description?

    As I mentioned above, I have a custom field, where the users can enter a meta description. I would like to display this text as meta description.

    If this is not possible, what shortcode do I need to enter to display the text, which is added to the editor? (screenshot 2)

    #535719

    Alex Rollin
    Moderator
    Post count: 27815

    You have the snippet active on your site?

    https://wpgeodirectory.com/support/topic/custom-field-to-be-used-as-meta-description/#post-438024

    Please share WP Admin and FTP credentials and a link to the snippet on your site.

    WordPress Credentials
    WP Admin Login URL:
    WP Admin Username:
    WP Admin Password:

    FTP Credentials
    FTP Host:
    FTP Port:
    FTP User:
    FTP Password:

    #535724

    Steffen
    Lifetime Member
    Post count: 48
    This reply has been marked as private.
    #535740

    Naveen Giri
    Moderator
    Post count: 1559
    This reply has been marked as private.
    #535747

    Steffen
    Lifetime Member
    Post count: 48

    Great Support! Thank you very much!!!

    #535775

    Alex Rollin
    Moderator
    Post count: 27815

    For other readers, you can use %%custom_meta_desc%% tag on Yoast meta fields with this snippet

    
    
    
    function _my_custom_meta_description_var_replace(){
      global $post;
     return $post->geodir_meta_desc;
    }
    
    add_action( 'wpseo_register_extra_replacements', function() {
      wpseo_register_var_replacement( '%%custom_meta_desc%%', '_my_custom_meta_description_var_replace', 'advanced', 'Some help text' );
    } );
    
Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket