Is it possible to make forum nodes no-follow to search engines?

stub

Member
Can this be done? If so. How to do this?

I have Categories below which I have Forums. I'd preferably like to set these at Category level. But I'd be equally at ease setting this at forum level. Just more work.

If both can be done, I'd like to know the solution for both, if the settings are different.
 
Last edited:
OK. But the addons can still be downloaded if logged in. Does anyone have either

1) this add-on which they could pass to me (if allowed), or
2) A username/password to log into xenmade.com website, or
3) Have any other workable solutions?

Thank you.
 
OK. But the addons can still be downloaded if logged in. Does anyone have either

1) this add-on which they could pass to me (if allowed), or
2) A username/password to log into xenmade.com website, or
3) Have any other workable solutions?

Thank you.
This is a paid add-on, you can no longer bought it. And of course, you are not allowed to share it. Have a look :
 
i am using this in page_container template... to prevent indexing of member pages. should work for nodes as well.

HTML:
<xf:if is="$__globals.template == 'member_view' OR $__globals.template == 'member_about' OR $__globals.template == 'member_latest_activity' OR $__globals.template == 'member_recent_content'">
<meta name="robots" content="noindex, nofollow">
</xf:if>
 
there is no permission to disable indexing from my understanding. what he was suggesting was to hide the nodes from guest view which would automatically hide them from search engine as well so the content would not get indexed.

<xf:if is="$__globals.forum.node_id = NODEID"> can be used to add <meta name="robots" content="noindex, nofollow"> for specific nodes.
 
there is no permission to disable indexing from my understanding. what he was suggesting was to hide the nodes from guest view which would automatically hide them from search engine as well so the content would not get indexed.

<xf:if is="$__globals.forum.node_id = NODEID"> can be used to add <meta name="robots" content="noindex, nofollow"> for specific nodes.

OK. But I don't really want to penalize potential members from browsing the website, which might turn them into members. It's search engines which I don't want indexing/following the content of those nodes. so that they don't appear in their search results. The content on these pages might not be economically beneficial to the posters in these forums, to have their dealings recorded for posterity, in perpetuity. This is what happens on competitor forums, and it's a real PITA. It's probably the biggest single motivating factor for starting the forum. If there is no easy solution, I intend to edit the xenforo code, to get this done. One way or the other.

Thanks for the code. Which file do I need to edit for this? Can this be applied specifically to 1 category heading and all forums beneath it. Or does it need to be applied to each forum node individually.
 
Last edited:
OK. But I don't really want to penalize potential members from browsing the website, which might turn them into members.
You're not penalizing any members whatsoever; you're doing exactly what you set out to do, which is to tell search engines to not index that page and to not follow any links on that page.
i am using this in page_container template... to prevent indexing of member pages. should work for nodes as well.

HTML:
<xf:if is="$__globals.template == 'member_view' OR $__globals.template == 'member_about' OR $__globals.template == 'member_latest_activity' OR $__globals.template == 'member_recent_content'">
<meta name="robots" content="noindex, nofollow">
</xf:if>
Although it works, the below code put on 4 templates would be best to alleviate an if conditional on 100s of irrelevant templates it's subsequently run on using PAGE_CONTAINER:
HTML:
<xf:head option="robots"><meta name="robots" content="noindex, nofollow" /></xf:head>
It might only make a minute change, but, I believe it would possibly decrease unnecessary load that could be used elsewhere.
 
But to answer your question, @stub, this is the way that I would do it.

First, I would put at the top of the forum_view template:
HTML:
<xf:if is="in_array({$forum.node_id}, [1, 2, 3])">
    <xf:head option="robots"><meta name="robots" content="noindex, nofollow" /></xf:head>
</xf:if>

But, you have to remember that threads can be moved from node to node and threads already exist in that node (obviously) and that the newest posts widget / what's new section can link to those specific threads too. If you want to exclude those from search engines as well as the node, you must put this at the top of the thread_view template:
HTML:
<xf:if is="in_array({$xf.reply.containerKey}, ['node-1', 'node-2', 'node-3'])">
    <xf:head option="robots"><meta name="robots" content="noindex, nofollow" /></xf:head>
</xf:if>

If you don't mind indexing/following of threads, ignore the second portion. Also, you can pop the below code in PAGE CONTAINER (not recommended in my opinion, and remove the OR portion of that too).

Alternatively, you can put this into the PAGE_CONTAINER template removing the <xf:head> tags but placing the <meta> tag in the appropriate place (where other <meta> tags are). However, it'd run on every template; a conditional unnecessary for 100s of sections and main portions of your site (say you have articles or classifieds, it'll run there too).
HTML:
<xf:if is="in_array({$forum.node_id}, [1, 2, 3]) OR in_array({$xf.reply.containerKey}, ['node-1', 'node-2', 'node-3'])">
    <meta name="robots" content="noindex, nofollow" />
</xf:if>
[/ICODE]
 
You're not penalizing any members whatsoever; you're doing exactly what you set out to do, which is to tell search engines to not index that page and to not follow any links on that page.

You seem to be responding to my message which was tackling only part of the message I was responding too.

member:OperaManiac said:
there is no permission to disable indexing from my understanding. what he was suggesting was to hide the nodes from guest view which would automatically hide them from search engine as well so the content would not get indexed.

I do not want to hide the messages from guest view like was stated in this text. My message was responding to a post by @beerForo.

The last part of @OperaManiac post seems to do exactly what I need to do.

member:OperaManiac said:
<xf:if is="$__globals.forum.node_id = NODEID"> can be used to add <meta name="robots" content="noindex, nofollow"> for specific nodes

I am not a coder by profession. Far from it. So I have to be very careful what I'm editing. Not to break the code. But I'm not adverse to making changes which won't break the code to achieve an end result :) I haven't yet studied your proposal in detail. I just wanted to clear up any misunderstanding.
 
@frm seems to have provided better solution. I plan to implement his version which would save the queries from running on non forum/thread pages.

these changes are quite simple as he has provided all the required details. make a child theme to experiment with these changes. edit the templates forum_view and thread_view adding the code at the top. change the node numbers to the forum ids where you want the metatag to appear. save and check if the changes appear in the new child theme on the forum!
 
@frm

To help make things more clear. There is 1 highest level node (Category) which will be affected by this code. Which is subdivided into 4 sub-node (Categories) which in turn hold 5 sub-node (Forums) each. Making a total of 20 sub-node (Forums) in total. This is only 1 highest level node (Category) among several others. I want to block indexing of this 1 highest level node (Category) only. it is possible that posts might get moved around within this 1 highest level (Category). But is not likely ever to be moved to a node outside of this 1 highest level (Category).

Which one of your 3 proposals would you suggest 1st, or 3rd. And why?

Even @OperaManiac seems to prefer your proposal :)
 
Back
Top Bottom