Remove shortlink link and meta tag generator I try to remove shortlink and generator link from my site.

&lt;meta name="generator" content="Drupal 7 (http://drupal.org)"&gt;
&lt;link rel="shortlink" href="http://landberg.at/nl/node/109"&gt;


I used below code in template.php but when i look in my source code its still there?

function landberg_html_head_alter(&amp;$head_elements) {
    unset($head_elements['system_meta_generator']);
    foreach ($head_elements as $key =&gt; $element) {
        if (isset($element['#attributes']['rel']) &amp;&amp; $element['#attributes']['rel'] == 'canonical') {
          unset($head_elements[$key]);
        }
        if (isset($element['#attributes']['rel']) &amp;&amp; $element['#attributes']['rel'] == 'shortlink') {
          unset($head_elements[$key]);
        }
    }
}


What is best way to remove this?
Above code is good but it didn't work because it was overwritten by Meta tag module. I adjust some settings in Configuration » Search and metadata and now generator tag and shortlink is gone.