删除Magento 1.9.3.x中的规范链接



我想从html页面(站点地图(中删除规范链接。

<link rel="canonical" href="https://www.example.com/seositemap">

我在布局中使用以下代码,但它不起作用

<?xml version="1.0"?>
<layout version="0.1.0">
<seositemap_index_index>
<reference name="content">
<block type="seositemap/map" name="map" template="seositemap/map.phtml"/>
</reference>
<reference name="head">
<action method="removeItem"><type>link_rel</type><rel>canonical</rel></action>
</reference>
</seositemap_index_index>
</layout>

知道吗?

这是该方法的样子

public function removeItem($type, $name)
{
unset($this->_data['items'][$type.'/'.$name]);
return $this;
}

没有 rel 参数。您应该改用"名称"。并且它的内容必须是当前链接的href

最新更新