如何设置noindex,跟在magento2的静态页面中?


10

我会在静态页面中将漫游器元标记设置为“ noindex,follow”。

对于Magento 1.9,我曾经这样做:

<reference name="head">
   <action method="setRobots"><value>NOINDEX,FOLLOW</value></action>
</reference>

在Magento 2中如何做?

Answers:



0

your_layout_handle.xml中

<?xml version="1.0"?>    
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <meta name="robots" content="NOINDEX,FOLLOW"/>
    </head>
</page>

0

我不确定,但是您可以尝试吗?

<?xml version="1.0"?>
    <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
      <head>
        <meta name="robots" content="NOINDEX,FOLLOW"/>
      </head>
     </layout>

0

首先,要去admin并找到Stores-> Configuration-> General-> Design-> Search Engine Robots-> Default Robots(选择)在这里,您可以将robots元标记设置为“ noindex,follow”。

对于特定的页面或句柄,可以使用XML。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.