How to Remove 301 Redirects in XenForo Forum?

Newman

New Member
Joined
May 11, 2021
Messages
11
Reaction score
0
Points
1
  • #1
I recently ran my web forum through an SEO crawler program and the results weren't great. I was told that I have way too many 301 redirects on the website. Actually, most of my site's links are redirects, which, from what I understand, is terrible for SEO. So right now, my goal is to get rid of these links. I either want them gone altogether or to keep the links, but remove the part that redirects. I looked around and have discovered that there are two different redirect types:

https://example.com/forum/threads/1/[B]post-1[/B]

https://example.com/forum/threads/1/[B]latest[/B]

Do you see the /post-1 and the /latest portions appended to the URLs above? This is what the link is supposed to look like without a redirect:

https://example.com/forum/threads/1/

How do I remove the redirects? Is there a setting in the ACP?
 

CraigHardy

New Member
Joined
May 11, 2021
Messages
12
Reaction score
1
Points
3
  • #2
To edit these links, you'll need to log into your ACP and navigate to Appearance > Templates. These are the templates you'll need to edit:

NODE_LIST_FORUM
NODE_LIST_SEARCH_FORUM
POST_MACROS
THREAD_LIST_MACROS

Code:
-------------------------------------------------

TEMPLATE: "NODE_LIST_FORUM"
line 128
<!-- REMOVE THREAD POST PORTION IN LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/post', $extras.LastThread, {'post_id': $extras.last_post_id}) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
<xf:else />
<a href="{{ link('threads', $extras.LastThread) }}" class="node-extra-title" title="{$extras.LastThread.title}">{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}</a>
</xf:if>
<!-- REMOVE THREAD POST PORTION IN LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "NODE_LIST_SEARCH_FORUM"
line 142
<!-- REMOVE THREAD POST PORTION IN LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/post', $extras.LastThread, {'post_id': $extras.last_post_id}) }}" class="node-extra-title" title="{$extras.LastThread.title}">
{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}
</a>
<xf:else />
<a href="{{ link('threads', $extras.LastThread) }}" class="node-extra-title" title="{$extras.LastThread.title}">
{{ prefix('thread', $extras.LastThread) }}{$extras.LastThread.title}
</a>
</xf:if>
<!-- REMOVE THREAD POST PORTION IN LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "POST_MACROS"
line 150
<!-- REMOVE POST DATE NUMBER LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}" rel="nofollow">
#{{ number($post.position + 1) }}
</a>
<xf:else />
#{{ number($post.position + 1) }}
</xf:if>
<!-- REMOVE POST DATE NUMBER LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "POST_MACROS"
line 128
<!-- REMOVE SHARE TOOLTIP LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}"
    class="message-attribution-gadget"
    data-xf-init="share-tooltip"
    data-href="{{ link('posts/share', $post) }}"
    aria-label="{{ phrase('share')|for_attr }}"
    rel="nofollow">
    <xf:fa icon="fa-share-alt"/>
</a>
<xf:else />
<xf:fa icon="fa-share-alt"/>
</xf:if>
<!-- REMOVE SHARE TOOLTIP LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "POST_MACROS"
line 108
<!-- REMOVE POST DATE LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/post', $thread, {'post_id': $post.post_id}) }}" rel="nofollow">
    <xf:date time="{$post.post_date}" itemprop="datePublished" />
</a>
<xf:else />
<xf:date time="{$post.post_date}" itemprop="datePublished" />
</xf:if>
<!-- REMOVE POST DATE LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "THREAD_LIST_MACROS"
line 218
<!-- REMOVE DATE LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<a href="{{ link('threads/latest', $thread) }}" rel="nofollow"><xf:date time="{$thread.last_post_date}" class="structItem-latestDate" /></a>
<xf:else />
<xf:date time="{$thread.last_post_date}" class="structItem-latestDate" />
</xf:if>
<!-- REMOVE DATE LINK FOR GUESTS -->

-------------------------------------------------

Code:
-------------------------------------------------

TEMPLATE: "THREAD_LIST_MACROS"
line 182
<!-- REMOVE DATE LINK FOR GUESTS -->
<xf:if is="$xf.visitor.user_id">
<li class="structItem-startDate"><a href="{{ link('threads', $thread) }}" rel="nofollow"><xf:date time="{$thread.post_date}" /></a></li>
<xf:else />
<li class="structItem-startDate"><xf:date time="{$thread.post_date}" /></li>
</xf:if>
<!-- REMOVE DATE LINK FOR GUESTS -->

-------------------------------------------------
 
How to Remove 301 Redirects in XenForo Forum? was posted on 06-11-2021 by Newman in the XenForo forum.

Similar threads

Forum statistics

Threads
88
Messages
156
Members
17
Latest member
mandy cromarty
Top