XF 2.2 How to remove site's name from meta title?

ritesh

Member
Hello, how do I remove the site's name from meta titles? It breaks the titles in search results sometimes due to added characters.

This part:
site-xenforo-com-Google-Search.png
 
Edit the PAGE_CONTAINER template.

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

Replace:
HTML:
<title><xf:title formatter="%s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" /></title>
 
Thank you for this thread!
I'd like to move it a little bit further - to remove site's name from meta titles not completely, but for some threads only (that have too long titles).

So I created a thread custom field "longtitle", put a value 1234 in it and expected that the following code will do it. But it doesn't. The " | boardTitle" is still in the title. Please advise.

<title>
<xf:if is="$thread.custom_fields.longtitle">
<xf:title formatter="%s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" />
<xf:else />
<xf:title formatter="%s | %s" fallback="{$xf.options.boardTitle}" page="{$pageNumber}" />
</xf:if>
</title>
 
Top Bottom