Xenforo - change homepage (boardtitle) meta page title

Sitebee

Technical SEO
Staff member
In this quick tutorial, I can show you a quick and easy method to change the Xenforo homepage (aka board title) meta page title. This guide uses Google Tag Manager to inject a page title using a JS script and a lookup table. It is really simple to follow and implement.

As a prerequisite, we are going to assume you already have a GTM container published on your website/forums. If not, creating and publishing a GTM container is easy. Login to your GTM workspace.

Step 1, create a custom HTML tag, in the tag configuration name the tag 'Xenforo Homepage Meta' and paste the following script in the html section.
Code:
<script>
  if({{Lookup Table - Meta Titles}}) {
    var t = document.createElement('title'); 
    t.innerText = {{Lookup Table - Meta Titles}}; 
    document.head.appendChild(t);
    document.title = {{Lookup Table - Meta Titles}} }
</script>

Step 2, set the tag firing to 'All Pages'

xenforo-homepage-title-1.JPG


Step 3, create a variable, name it 'Lookup Table - Meta Titles'. The variable type is a lookup table and set the Input Variable to Page Path.

xenforo-homepage-title-2.JPG


Step 4, In the variable Lookup Table, add the relative path in the 'Input' and in the 'Output' add in the desired page title. Save the variable and publish the GTM container.

xenforo-homepage-title-3.JPG



Head back to your forum homepage, refresh the browser tab. You should be able to see the injected page title. If not double-check the tag, trigger and variable settings again. If you get stuck reply below and I will help you troubleshoot and resolve.

xenforo-homepage-title-4.JPG





It is worth saying that this method is SEO friendly. Google will index and parse the JS injected page title. It might take Google a few days to update the newly updated page title in the SERPs. Remember the page title best practice length is 35 - 60 character length.