• Hii

    i found adding auto meta tag plugin
    http://www.raoul.shacknet.nu/2006/01/05/add-meta-tags-wordpress-plugin

    problem is it show description as first few word from post and category name as keyword

    i like to show post title as descrption do its possible to modify the code

    present code in the plugin

    function amt_add_meta_tags() {
    global $posts;

    if ( is_single() ) {
    // Description
    $my_metatags = “\n<meta name=\”description\” content=\”” . strip_tags(get_the_excerpt()) . “\” />”;
    // Keywords
    $my_metatags .= “\n<meta name=\”keywords\” content=\””;
    foreach((get_the_category($posts[0]->ID)) as $cat) {
    $my_metatags .= $cat->category_nicename . ‘, ‘;
    }
    $my_metatags = substr($my_metatags, 0, -2) . “\” />\n”;
    }
    echo $my_metatags;
    }

    add_action(‘wp_head’, ‘amt_add_meta_tags’);

    ?>

The topic ‘auto meta tag plugin need help’ is closed to new replies.