10

I would set the robots meta tags to "noindex,follow" in a static page.

For Magento 1.9 I used to do it like this:

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

How to do it in Magento 2?

1

You can set it admin. for magento. For Magento 2.1 & 2.2 Go to Content > Configuration. please edit your theme .you can see your screen as attached screen shot. i have highlighted seo robots section. : https://i.stack.imgur.com/cP1Si.png

For Magento 2.0 you can check here : https://www.mageworx.com/wiki/magento-2-robots/

0

In 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

I am not sure but can you try ?

<?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

The very first thing go to admin and find Stores -> Configuration -> General -> Design -> Search Engine Robots -> Default Robots (Select) Here you can set the robots meta tags to "noindex,follow".

For particular page or handle you can use XML.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.