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:
@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!

I'm assuming I can make and delete a Child Theme at any time and won't lose all the configuring I have done to date? I have not edited any code to date from the standard theme, only played with it's settings. I'm also probably going to buy and install UI.X2 Theme. Which will be the theme I will clone to a child theme. Should I start configuring the UI.X2 theme before cloning it, or should I immediately create the child theme from it? Or doesn't it matter, since it's only the settings?
 
Last edited:
I'm assuming I can make and delete a Child Theme at any time and won't lose all the configuring I have done to date?
Yes. If you're uncomfortable editing templates, test the code on a child theme only you can swap to (admin) -- if you care.
Should I start configuring the UI.X2 theme before cloning it, or should I immediately create the child theme from it? Or doesn't it matter, since it's only the settings?
I'm not too familiar with the UI theme, but best practice is to always create a child theme and to make that selectable. Create a 2nd child theme for edits only seen to yourself, or use a dev setup and then carry edits over.
I want to block indexing of this 1 highest level node (Category) only.
Now that you brought up categories, there is 1 other template that needs to be modified, category_view, which would noindex/nofollow those listed in the category view as well. The same would apply, putting the category node ids in place of forum node ids (in lamen terms, the number after the dot on the URL in category view). If there are more than one, use the following code again.
Code:
<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>
Except that node-1, node-2, and node-3 are categories instead of regular forums instead.

I would chomp out the in_array if you only want 1 category, though.
Code:
<xf:if is="$xf.reply.containerKey == 'node-1'">
    <xf:head option="robots"><meta name="robots" content="noindex, nofollow" /></xf:head>
</xf:if>

The problem we run into here is on your main forum, they're still listed so they will still be followed. We can add the rel="nofollow" tag to specific forums, but adding noindex/nofollow to category_view (if you want the category page noindex'ed as well), forum_view, and thread_view should suffice the search engine's reach beyond going to the forum from the index. Otherwise, you will need more complex node_list* template edits to add the rel tag to specific nodes on your main forum view layout.
 
... 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. ...

The only proper way to handle this is to make the nodes unavailable to guests. Even if you successfully add rel="nofollow" to every link to the forums/threads, bad bots can still index the content. Maybe Google ignores it, but some podunk site might not, so the content may still leak and be available via web searches indirectly. Does archive.org (Wayback Machine) respect rel=nofollow? I'm not sure.
 
@frm

I'm not belittling or ignoring anyone's advice. But you seem to have understood my wants/needs best. Which is probably my fault from not explaining myself clearly enough. I would appreciate very much if you could put into 1 post your comprehensive edits, and to which files, you suggest to achieve my goals.

And just to repeat my goals. I want to prevent search engines from recording for posterity (or at all) one complete Category tree (one of several) of about 20 forum nodes and 5 category nodes including the top category. None of these category nodes have any content. I cannot see that I can do much about rogue engines (like maybe archive.org) without also affecting adversely visitors to the website who are not members. I want members/non-members alike to enjoy full use of my forum. But even if there is a partial solution. I'd like to here it.

Where I have got into a slight muddle is the comprehensive list of files I need to edit to affect these changes. So I'd would very much appreciate if you could tell me again which files I need to edit, and the edit I need to make. Does the edit need to be in a specific location in these files, or can they be simply tacked onto the end of each file?

If there is any further information you need from me that needs to be clarified, before you begin. Just ask. Thank you.

I have purchased the UI.X2 theme. I'm having problems installing it, which seems incredible to me, and the time of this install is dragging on, by getting some vague replies from ThemeHouse and the fact that I live on the opposite side of the world, so one round of question and answer takes at least 2 days, or more, if the problem is not solved immediately. And this has just started :( On the bright side. It will give me a chance to play around with child themes on xenForo, ready for when I get UI.X2 theme installed and creating a child them from that :)
 
OK. I'm about to embark on this.

First question is where do I find a list of the forum node ID's

Next question is can I do this for a top level category (which is just a heading) and have the command apply to all sub-forums beneath the top level category?
 
First question is where do I find a list of the forum node ID's
Easiest way is inspecting the URL of the node or thread. Example, this thread is in the Forum management forum which has a URL of https://xenforo.com/community/forums/forum-management.84/, telling me it's node 84. You can also hover over Nodes in ACP to find it, which is what you'll have to do for parents.
Next question is can I do this for a top level category (which is just a heading) and have the command apply to all sub-forums beneath the top level category?
You'll need to edit category_view for the parent and thread_view for the threads.
 
1) Easiest way is inspecting the URL of the node or thread. Example, this thread is in the Forum management forum which has a URL of https://xenforo.com/community/forums/forum-management.84/, telling me it's node 84. You can also hover over Nodes in ACP to find it, which is what you'll have to do for parents.

2) You'll need to edit category_view for the parent and thread_view for the threads.

1) So. I only need to refer to the forum number? Or do (or can) I have to refer to the full name and number? (ie: forum_name.64)

2) This second one is giving me some headaches to understand. Is this an either/or situation? I can simply do 1) edit the forum view template and ignore 2), or I have to do both 1) and 2). If I want to be comprehensive in making posts, unsearchable. Is the code identical for both category_ view and thread_view edits? Where should I put the code in the template 1)top, 2)bottom, 3) specific place?

2a) I noticed in your forum_view template edit. You only mention the forum number, but in you edit for category_view and thread_view edits you mentioned "node-1". But just to be sure. You are still only referring to just a number, or is the text "node-" important?

I seem to have completed the forum_view edit (which seems to have been the easy part) :)
 
Last edited:
You'll need to edit category_view for the parent and thread_view for the threads.

So can you please confirm that if I've completed the forum_view edit. It's all I need to prevent the search engines looking at these nodes? And that I don't need to edit the category_view and thread_view templates, if I don't need to do this same operation at only the category heading level (as opposed to sub-node level). And since I've done this by node level in the forum_view edit. I've completed this task. With nothing more to do?

I was asking if I could do this at Category header level for all sub-nodes under that category, only because I thought it might be easier. But it seems more complicated, and unnecessary. As I've already completed that task in the forum_view template?

I apologize if I seem to be harping on this. It's because I'm only a beginner, and you are the expert :)
 
@frm or anybody

I really would like to get this question answered before I go on vacation on 3rd Sept. Is the modification I've done to forum_view edit according to @frm's instructions, all I need to do to prevent search engines indexing specific nodes? Is the mod now complete? Or is there something else I must do?
 
@frm or anybody

I really would like to get this question answered before I go on vacation on 3rd Sept. Is the modification I've done to forum_view edit according to @frm's instructions, all I need to do to prevent search engines indexing specific nodes? Is the mod now complete? Or is there something else I must do?
I'd have to examine your page sources to determine that.

I gave quite a bit of info on how to somewhat patch most, if not all, the pages, which is a good starting point for you to learn as I have.

But, I do have my own forum to run and I'm not here to just completely modify other people's forums without benefit to me in some way (like using the same code, but this instance I would never use so it disinterests me in compiling a full step by step tutorial).

I can give you a quick yes or no by viewing source, or you can by finding "nofollow" and "noindex" on pages you want that way.

Thanks
 
I'd have to examine your page sources to determine that.

I gave quite a bit of info on how to somewhat patch most, if not all, the pages, which is a good starting point for you to learn as I have.

But, I do have my own forum to run and I'm not here to just completely modify other people's forums without benefit to me in some way (like using the same code, but this instance I would never use so it disinterests me in compiling a full step by step tutorial).

I can give you a quick yes or no by viewing source, or you can by finding "nofollow" and "noindex" on pages you want that way.

Thanks

Let me say again that I really have appreciated all the help you have given to date. It has been extremely helpful. I'm not really pushing you to do more for me. You answered my first question fully. I'm not going to be asking you to check my code. If I got the code wrong. That's my fault. I simply cut 'n pasted your code (I did check, as best as I was able, if there were any syntax errors), and edited the nodes to reflect the nodes I wanted, and pasted it to the top of the forum_view edit. I got it.

I then went on to ask you (before realizing how easy it was to do this edit) if I could do this at the top level node category. And you were generous enough to supply that code as well. I started to try to edit that, and had some questions. But then realized, that the first step was easy enough to do, so really didn't think I needed to do this at the top level node category. And besides it was more complicated than the first step.

So. I'm really asking if that first step is enough to achieve my goals? Which was to have the search engines to nosearch/nofollow specific nodes. Or is there any other steps needed? If this first step is enough. Great. If something else is needed. Then what? If you don't want to supply any more code to the what? Great also. I just need if there is any more what? And, I'll just keep asking for help about the what, here. You don't need to reply. If you don't feel like it. And I will not quote you any more.

Cheers
 
Last edited:
  • Like
Reactions: frm
Which was to have the search engines to nosearch/nofollow specific nodes.
The nofollow nodes will be the hardest part because you will need to edit macros that list each node and add that attribute to the node's <a> tag in the loop; a much more complicated edit.

However, even though a search engine (Google, for instance, not a nefarious one that ignores metatags), will respect not indexing the content on that page you have set (and nofollow anything in category_view--but definitely not something I'd put on forum_list).

That's why I'd put it on thread_view and category_view, but forum_list (for no follow) and category_view (for nofollow) will be harder edits that I'm just not willing to vest the time to make the edits.

That should suffice, because they will follow into the nodes, but they won't index the listings that they're on, nor the threads if you carried it into that as well.

And by source, I mean't right click->view source to see if it's rendering properly.
 
Top Bottom