Yoast SEO
Returning the Meta Description (3 posts)

  1. Dillx
    Posted 3 years ago #

    Version 0.2.3 says
    Meta Description can now be returned, using $wpseo_front->metadesc( false ); for use elsewhere.

    Do you have a recommended method / example of using this ?


  2. Dillx
    Posted 3 years ago #

    Have tried this which I found in some other threads but it produces nothing.

    $wpseo = new WPSEO_Frontend();
    echo $wpseo->metadesc( false );

    and this

    echo $wpseo_front->metadesc( false );
    produces an error
    Fatal error: Call to a member function metadesc() on a non-object

  3. Dillx
    Posted 3 years ago #

    Well I found this in another post
    and this seems to work.

    $metadesc = wpseo_get_value('metadesc');

    Be interested to know what the official usage should be.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic