Site icon @Poremsky.com

Remove Member links from Xenforo forum

I recently upgraded OutlookForums from VBulletin to XenForo and now I'm working on tweaks and making sure the redirections are working and old links aren't generating 404 errors.

One thing that annoys me to no end is search engines indexing the members list. While I can block it with robots and hide it from non-members, the links still work but generate those dreaded 404 errors. The end result is Webmaster tools complains about the blocked links and 404's. They say a site is not penalized, but I'd still rather the member urls not be indexed at all.

So… I put an end to it. I removed links (and some fields that really offer no benefit to my forum members) from the member card overlay and hid all personal fields in the members profile from non-members.

It was actually fairly easy, once I found the correct templates to edit. I just needed to add an If statement (and the matching End If) to the code blocks:

<xen:if is="{$visitor.user_id}">

Initially I edited the member card to remove links, which was ok, especially after I edited the Profile page to remove all but the basics and gave the non-registered guest usergroup permission to see member cards and profiles.

Then I started digging and finally figured out how to remove the hyperlinks from the avatar and username, replacing the username line with:

{$user.username}

I probably went a little overboard in removing the user metadata from the posts (and I might and some fields back), but I wanted a clean, fast, error free site for search engines (and guests).

While I could remove signatures for guests, I'm using an add-in that displays the signature once per page and set the guest user group to use this option.

Edit Template: member_card

<xen:edithint template="xenforo_overlay.css" />
<xen:require css="member_card.css" />

<div id="memberCard{$user.user_id}" data-overlayClass="memberCard">
<div class="avatarCropper">

<xen:if is="{$visitor.user_id}">

<xen:else />

</xen:if>

<!– snip –>

<div class="userInfo">
<xen:if is="{$visitor.user_id}">
<h3 class="username"><xen:username user="$user" class="NoOverlay" /></h3
<xen:else />
<h3 class="username">{$user.username}</h3>
</xen:if>

Edit Template: message_user_info

<xen:require css="message_user_info.css" />

<div class="messageUserInfo" itemscope="itemscope" itemtype="http://data-vocabulary.org/Person">
<div class="messageUserBlock">
<xen:hook name="message_user_info_avatar" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
<div class="avatarHolder">
<span class="helper"></span>

<xen:if is="{$visitor.user_id}">
<xen:avatar user="$user" size="m" img="true" />
<xen:else />

</xen:if>

<!– slot: message_user_info_avatar –>
</div>
</xen:hook>

<xen:if is="!{$isQuickReply}">
<xen:hook name="message_user_info_text" params="{xen:array 'user={$user}', 'isQuickReply={$isQuickReply}'}">
<h3 class="userText">

<xen:if is="{$visitor.user_id}">
<xen:username user="$user" itemprop="name" rich="true" />
<xen:else />
<h3 class="username">{$user.username}</h3>
</xen:if>

Edit Template: member_view

Because the link to member profiles is pretty much gone from the site, search engines will be the only guests viewing it. The profile page shows just the very basics, little personal information and links to threads. This is much better than a page not found or a not authorized error.

This page was a bit more complicated to edit, mostly because it was easier to put the end if in the wrong place and screw up the code. I was able to drop just the {$user.username} field in some existing If statements, which made it easier. (I probably should just delete the fields I don't care about, like sex and age, if only to eliminate database calls.)

<!– snip –>
<xen:if is="{$canViewOnlineStatus} AND {$visitor.user_id}">
<dl><dt>{xen:phrase last_activity}:</dt>
<dd><xen:datetime time="$user.effective_last_activity" /></dd></dl>
</xen:if>
<!– snip –>
Exit mobile version