skip to Main Content

Below line of code is present in my template’s head.phtml

<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />

But when I view source of page the meta keywords tag is missing. Somehow Magento is removing the entire tag.

Can you please tell me how to fix it?

4

Answers


  1. Chosen as BEST ANSWER

    This was happening due to Creare SEO extension.


  2. Did you refresh the Magento cache?

    System --> Cache Management
    

    Maybe also clear your browser cache.

    If this doesn’t work, try adding a dummy meta tag:

    Then refresh the cache again:

    System --> Cache Management 
    

    Let me know if this works for you.

    Login or Signup to reply.
  3. did you edit the code in your template folder or the core base? you have to edit the default head.phtml in

    app/design/frontend/base/default/template/page/html

    and if this is where you changed it, make sure you save your old version in-case you need to revert back, in this case i usually just add () around the file name so i know its the previous version. Now try the following new version. the code should be the following:

    <?php
    /**
    * Magento
    *
    * NOTICE OF LICENSE
    *
    * This source file is subject to the Academic Free License (AFL 3.0)
    * that is bundled with this package in the file LICENSE_AFL.txt.
    * It is also available through the world-wide-web at this URL:
    * http://opensource.org/licenses/afl-3.0.php
    * If you did not receive a copy of the license and are unable to
    * obtain it through the world-wide-web, please send an email
    * to [email protected] so we can send you a copy immediately.
    *
    * DISCLAIMER
    *
    * Do not edit or add to this file if you wish to upgrade Magento to newer
    * versions in the future. If you wish to customize Magento for your
    * needs please refer to http://www.magento.com for more information.
    *
    * @category    design
    * @package     base_default
    * @copyright   Copyright (c) 2006-2014 X.commerce, Inc.    (http://www.magento.com)
    * @license     http://opensource.org/licenses/afl-3.0.php  Academic  Free License (AFL 3.0)
    */
    ?>
    <meta http-equiv="Content-Type" content="<?php echo $this-   >getContentType() ?>" />
    <title><?php echo $this->getTitle() ?></title>
    <meta name="description" content="<?php echo htmlspecialchars($this-   >getDescription()) ?>" />
    <meta name="keywords" content="<?php echo htmlspecialchars($this-   >getKeywords()) ?>" />
    <meta name="robots" content="<?php echo htmlspecialchars($this-   >getRobots()) ?>" />
    <link rel="icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
    <link rel="shortcut icon" href="<?php echo $this->getFaviconFile(); ?>" type="image/x-icon" />
    <!--[if lt IE 7]>
    <script type="text/javascript">
    //<![CDATA[
     var BLANK_URL = '<?php echo $this->helper('core/js')->getJsUrl('blank.html') ?>';
     var BLANK_IMG = '<?php echo $this->helper('core/js')- >getJsUrl('spacer.gif') ?>';
    //]]>
    </script>
    <![endif]-->
    <?php echo $this->getCssJsHtml() ?>
    <?php echo $this->getChildHtml() ?>
    <?php echo $this->helper('core/js')->getTranslatorScript() ?>
    <?php echo $this->getIncludes() ?>
    enter code here
    

    Once you have reverted, log in to your admin panel, navigate to system/configuration/design scroll down and enter your keywords into the field. Separate each with a comma. Sign out of admin. Clear the browser cache, and sign back in.

    Login or Signup to reply.
  4. As @tahir-yasin mention this is due to Creare SEO, but you don’t need to uninstall this extension. Go to your Settings>Configuration>
    In CREARE SEO find General Settings and change ”
    Disable Meta Keywords Tag and Empty Meta Description Tags?” to “No” your problem will be solved..

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search