Magento meta关键字标签未显示

时间:2015-03-31 19:32:05

标签: magento seo meta-tags

下面的代码行出现在我的模板head.phtml

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

但是当我查看页面源时,缺少meta关键字标签。不知何故,Magento正在移除整个标签。

你能告诉我如何解决它吗?

4 个答案:

答案 0 :(得分:1)

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

答案 1 :(得分:0)

您是否刷新了Magento缓存?

System --> Cache Management

也许还要清除浏览器缓存。

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

然后再次刷新缓存:

System --> Cache Management 

请告诉我这是否适合您。

答案 2 :(得分:0)

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

中编辑默认的head.phtml

应用程序/设计/前端/碱/默认/模板/页/ 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

恢复后,登录管理面板,导航至系统/配置/设计向下滚动并在字段中输入关键字。用逗号分隔每个。退出管理员。清除浏览器缓存,然后重新登录。

答案 3 :(得分:0)

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