XF 2.0 How to remove Forum Name in title of Forum view and thread view?

webmastersun

Active member
Can anyone tell me how to remove Forum Name in title of Forum view and thread view?

For examples:
Forum:
https://xenforo.com/community/forums/xenforo-pre-sales-questions.5/

Title tag is:

<title>XenForo pre-sales questions | XenForo community</title>

I want to remove | XenForo community

Thread:
https://xenforo.com/community/threads/looking-at-moving-neighbours-ie-from-vb4-to-xf2.141988/

<title>looking at moving neighbours.ie from vb4 to XF2 | XenForo community</title>

I wan to remove | XenForo community

Because on my forum, forum name is long so when combining with thread title, then its becoming.... :(

I don't see an option in ACP to remove this.


Thanks
 
Edit the PAGE_CONTAINER template

Find this line:

Code:
<title><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>

Change it to:

Code:
<title><xf:title formatter="%s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
 
Edit the PAGE_CONTAINER template

Find this line:

Code:
<title><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>

Change it to:

Code:
<title><xf:title formatter="%s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
Hi Bryan,

Your tweak is perfect, but it's affecting other pages other than threads. Is there any way to do this for threads alone and not the forum list, help pages, etc.?
 
No, that isn't what this post is about. It's about the SEO Title (visible only on the browser's tab), and template edit is needed to make it work. I can't find the
Code:
<title><xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
code any where in the thread_view template to make the edit.
 
The browser tab?? Just put your title in the basic options in acp.
To understand this better, visit this URL or any other topic here with a shorter title. Hover over the (active) tab, and you'll see the Xenforo community added after the thread's title. I want that part removed for threads only, and the code provided here works; the only limitation is that it removes the board title for contact, privacy, terms, forum list, and help pages, but I only want it removed for thread pages alone.
 

Attachments

  • to understand.webp
    to understand.webp
    12.9 KB · Views: 2
Top Bottom