Magento 元关键字标签未显示

Magento meta keywords tag not showing

我的模板 head.phtml

中存在以下代码行
<meta name="keywords" content="<?php echo htmlspecialchars($this->getKeywords()) ?>" />

但是当我查看页面源代码时,元关键字标签丢失了。 Magento 以某种方式删除了整个标签。

你能告诉我如何解决吗?

您是否刷新了 Magento 缓存?

System --> Cache Management

也许还可以清除浏览器缓存。

如果这不起作用,请尝试添加虚拟元标记:

然后再次刷新缓存:

System --> Cache Management 

让我知道这是否适合你。

您是否编辑了模板文件夹或核心库中的代码?您必须在

中编辑默认值 head.phtml

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

如果这是你更改它的地方,请确保你保存了旧版本以防你需要还原,在这种情况下我通常只在文件名周围添加 () 这样我就知道它是以前的版本.现在尝试以下新版本。代码应如下所示:

<?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 license@magento.com 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

恢复后,登录管理面板,导航至 system/configuration/design 向下滚动并在字段中输入关键字。用逗号分隔每个。注销管理员。清除浏览器缓存,然后重新登录。

发生这种情况是由于 Creare SEO 扩展。

正如@tahir-yasin 提到的,这是由于 Creare SEO,但您不需要卸载此扩展程序。转到您的设置>配置> 在 CREARE SEO 中找到常规设置并更改“ 禁用元关键字标签和空元描述标签?” "No" 您的问题将得到解决..