Yoast SEO
[Plugin: WordPress SEO by Yoast] Attachment description in title tag? (2 posts)

  1. cosmictap
    Posted 5 years ago #

    Just installed this - what a great plugin.

    I don't see a way in the options for "titles" to utilize the "description" from a media/gallery item in the attachment page title. Is there?

    I'd like the meta description for each attachment page to pull from the attachment's "description" field, as weird as that may sound. ;)

    Thank you!


  2. cosmictap
    Posted 5 years ago #

    For others who may want to do this, I have found apparent success by adding this line:

    '%%att_desc%%' => $r->post_content,

    to the end of the

    $replacements = array(

    function in wpseo-functions.php.

    (And then, of course, using the %%att_desc%% variable appropriately in the SEO title options.)

Topic Closed

This topic has been closed to new replies.

About this Plugin

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

About this Topic