XF 1.5 SEO - reducing links for guest users

#1
I'm trying to dramatically reduce the number of links on my site that are viewable to guests, as most of these links go to member profiles, which I don't want Google indexing, anyway. So that they remain usable to members, I'm going to wrap the targeted links in
Code:
<xen:if is="!{xen:helper ismemberof, $visitor, 1}"></xen:if>
I've taken screenshots highlighting and numbering the links I'm trying to remove, and I'm hoping you can tell me where to find them in the templates. Thanks!

upload_2017-6-18_9-26-59.png
upload_2017-6-18_9-30-55.png
 
#3
Ok, thanks, I think I can track down those elements with firebug. Any tips on how to modify this so that the hyperlink isn't displayed to guests? I thought I would just wrap the whole thing in a xen:if statement, but now I see that method would remove the entire element, not just the hyperlink.
Code:
<dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed" rel="nofollow">{xen:number $user.message_count}</a></dd>
 

Brogan

XenForo moderator
Staff member
#4
You would have to do an if/else with the original content for logged in member, else the modified content for guests.
 
#5
Ah, right, that makes sense. Is this the right way to do it?
Code:
<xen:if is="!{xen:helper ismemberof, $visitor, 1}">
<dd>{xen:number $user.message_count}</dd>
<xen:else />
<dd><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}" class="concealed" rel="nofollow">{xen:number $user.message_count}</a></dd>
</xen:if>
 
Top