0

I want to set robots: noindex, nofollow for 1 specific category. I thought I just add a line in a source code like:

if (stripos($categoryName, 'MyCategoryName') !== false) { $this->layoutFactory->setRobots('NOINDEX,NOFOLLOW');

but I cannot locate the source code file, where the function for reading robots configuration from admin panel is.

Does anyone knows, where the file is? Or is there a better solution to make this work?

There are some topics here, but none says where the source code file is located.

Best regards,

Chris


Thanks for the fast response. Actually I wanted to do this as you wrote. Unfortunatelly I cannot update it this way. The option doesn't work on any of the categories and I tried everything I could find.

Please see the picture. There is no possibility to update the design. enter image description here

Thanks for further help in advance.

Best regards,

Chris

1 Answer 1

0

You can do this by updating category Layout Update XML in admin.

Admin - > Products -> Categories -> Select the category -> Design -> Layout Update XML -> Add the below code -> Save

<head>
    <meta name="robots" content="NOINDEX,NOFOLLOW"/>
</head>

Remove cache and check. You can see the changes in front end product category page source.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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