XF 1.5 How to disallow crawling complete RM and one Node through robots.txt

Sunka

Well-known member
What to add in robots.txt file to disallow Google and other spiders from crawling complete Resources manager and one complete Category (included all in it)?
Thanks (y)
 
If you just want to disallow the entire RM, then you can block /resources/. However, if you are trying to block a single category, you can't do this via robots.txt. You would need to modify the resource_view template:

Code:
<xen:if is="{$resource.resource_category_id} == 123">
<xen:container var="$head.noindex"><meta name="robots" content="noindex" /></xen:container>
</xen:if>

(I haven't tested this, so please check the code is being output when you expect.)
 
Ah, the concept is similar but a different template/condition. You'd be checking thread_view and acting based on {$forum.node_id} .
 
You'd be checking thread_view and acting based on {$forum.node_id} .

If node ID is for example 123
This will be right code:

Code:
<xen:if is="{$forum.node_id} == 123">
<xen:container var="$head.noindex"><meta name="robots" content="noindex" /></xen:container>
</xen:if>

Where to put that code in thread_view template?
 
Top Bottom