How to use drupal_add_html_head() to add the same metatag multiple times? I have a node which has multiple images attached to it. And each image should also be printed in a &lt;meta property="og:image" content="image_url" /&gt; metatag. I have tried to use drupal_add_html_head() for each image in a template_preprocess_page(), but only the last image is printed as metatag.

function mytheme_preprocess_page(&amp;$variables) {
...
    // add multiple og:image tags
    foreach ($images as $image) {
        $element = array(
            '#tag' =&gt; 'meta',
            '#attributes' =&gt; array(
                "property" =&gt; "og:image",
                "content" =&gt; $image,
            ),
        );
        drupal_add_html_head($element,'facebook_share_image');
    }
}
The tags are stored by key, so using a different key for each should do the trick:

$delta = 0;
foreach ($images as $image) {
    $element = array(
        '#tag' =&gt; 'meta',
        '#attributes' =&gt; array(
            "property" =&gt; "og:image",
            "content" =&gt; $image,
        ),
    );
    drupal_add_html_head($element,'facebook_share_image:' . $delta++);
}