Use Gallery and Image Descriptions for search engines (meta)

Hi,
We want to use the album and image descriptions for the page meta description.

ie:

<meta name="description" content="<?php echo printImageDesc(); ?>" />
<meta name="description" content="<?php echo printAlbumDesc(); ?>" />

Is this the correct method and do we need to format them to remove line breaks etc ?

Many thanks.

Comments

  • acrylian Administrator, Developer
    First, functions with a beginning "print" already echo themselves...:) The ones starting with "get" need to be echoed.
    For meta tags you better use the "getBare" functions (see the doc). These already strip html tags etc. from the content to be used in img alt or title tags.
  • Hi, ok great!

    Have used: <meta name="description" content="<?php echo getBareAlbumDesc(); ?>" />

    If I view source there is a line break as below,

    <meta name="description" content="Photographing birds is not only a challenge but a real pleasure. Gives you a chance to study hehaviour, bird calls
    and much more.
    You just need lots of patience and a flask of coffee at the ready." />

    Is that just whitespace in the text, sorry just need to check.

    Pat
  • acrylian Administrator, Developer
    Actually it should strip all tags, it might be that a invisible linebreak got through. I don't think this harms.
  • Hi, ok will wait and see how it looks on the search engines.

    Thankyou for your support!

    Pat
Sign In or Register to comment.