Search

How Can I Edit XenForo Reaction Row Links?

  • Thread starter Phoenix1
  • Start date
Phoenix1

Phoenix1

Member
Joined
May 7, 2021
Messages
135
Reaction Score
0
Points
23
  • #1
I have thousands of "likes" on my XenForo forum and every single on of those likes (reactions) has created a link. Humans who click these links see popups that list all of the members who have reacted to particular posts. Search engines, however, see entirely new pages. The pages contain the same links as the popup pages do; just links to the member pages. The pages that the search engines see do have noindex meta tags on them, but really, they're not meant to be crawled. To deal with this, I have three options. I can allow these pages to be crawled, I can block these pages in the robots.txt file and leave the links on the site, or I can block the pages in the robots.txt file and remove the links from the site so the search engines can't see them. Personally, I would like to remove the links and block them because there are just so many of them. I don't want blocked links to affect the pagerank flow of my website. I don't think any humans click these links anyway. Why would they? Also, this type of link can grow across a popular forum very quickly. Every single time a member "likes" a post, a new link is formed and that's not good at all. Before long, a site owner can potentially have thousands of these reaction pages that are crawled or thousands of pages that are blocked. I'd like to take these links out of the equation all together.

This is an example of what these reaction links look like:

xenforo-reaction-row-301-redirect-links.gif

Any advice? Does anyone know which templates I have to edit to remove the link portion of the text? I want to leave the text as is and only remove the link. Also, what code do I need to change in the template?
 
Newman

Newman

Member
Joined
May 11, 2021
Messages
106
Reaction Score
0
Points
23
  • #2
Your best bet is to block the /posts/ directory in your site's robots.txt file. Everyone who runs XenForo forums does this. It's common knowledge. Then, once that's done, remove the reaction links for guests only. This way, to guests and search engines, no link will exist, but to members who are logged in, a link will exist and things will be completely normal.

The template you'll need to edit is called reaction_list_row. On line 5, look for this code:

Code:
<a class="reactionsBar-link" href="{{ link($link, $content, $linkParams) }}" data-xf-click="overlay" data-cache="false">{$reactions}</a>

Replace the above code with this new code:

Code:
<xf:if is="$xf.visitor.user_id">

<a class="reactionsBar-link" href="{{ link($link, $content, $linkParams) }}" data-xf-click="overlay" data-cache="false">{$reactions}</a>

<xf:else />

{$reactions}

</xf:if>

This will do exactly what you want. Let me know if this helps.
 
Top