Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Meta titles with page numbers on discussions, categories and threads?

Running version 2.1.11

I am ending up with a lot of duplicate meta titles due to pagination. Is there a way to add the page number into the meta title?

This issue is present on the home page:
example.com/forum/
example.com/forum/p2

The discussions page:
example.com/forum/discussions
example.com/forum/discussions/p2

Category pages:
example.com/forum/categories/category-name/
example.com/forum/categories/category-name/p2

And threads:
example.com/forum/discussion/123/thread-title
example.com/forum/discussion/123/thread-title/p2

And tag pages:
example.com/forum/discussions/tagged/tagname/
example.com/forum/discussions/tagged/tagname/p2

Is there any way to add the page number into the meta titles on paginated pages?

Example:
I do have the VanillaSEO plugin, but it has no options for this. Any ideas?

Tagged:

Comments

  • Options
    hgtonighthgtonight ∞ · New Moderator

    I am not sure what you want. What is a meta title?

    If this is some ploy for SEO, abandon it and concentrate on your content.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options

    The content is fine - but there are many other factors involved in SEO.

    Here's a direct quote from Google:
    "Avoid repeated or boilerplate titles. It’s important to have distinct, descriptive titles for each page on your site."
    https://support.google.com/webmasters/answer/35624?hl=en

    In addition, relevant unique titles lead to better click through rates in search engine results.

    For example:
    say you run a forum about animals, and have categories for each type of animal out there.

    Someone searches for "giraffe", and your category page shows up, but the title says "Animal Forum", whereas the other titles in the search results say "Giraffe" - you are now the least likely result to be clicked on.

    I can say with 100% certainty that relevant unique page titles make a difference both in rankings and click through rates.

    Is there any function in Vanilla that could output the page number into the titles where applicable?

  • Options
    hgtonighthgtonight ∞ · New Moderator
    edited June 2015

    From that exact same paragraph: "Another option is to just use "" as a concise title and use the meta description (see below) to describe your site's content."

    I still don't understand what tag you are trying to modify. You set the category description in the dashboard.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Options
    edited June 2015

    That line about the concise title and meta description was related to a specific example that doesn't really apply to this situation.

    I have trying to modify the
    < title >
    in the
    < head >

    (spaces added so it wouldn't be stripped out)

  • Options
    BleistivtBleistivt Moderator
    edited June 2015

    In 2.2 the title will show the page number if you are on a page > 1 if that is what you meant.

  • Options

    That's good news, but isn't that only on the threads? I believe this forum is running 2.2, and the additional pages in the categories and main forum page do not include the page number in the title. Is it possible to add that function to those sections as well?

  • Options
    BleistivtBleistivt Moderator

    You can do it with a simple plugin:

    public function discussionsController_render_before($sender) {
        $page = $sender->data('_Page');
        if ($page > 1) {
            $sender->setData('Title', $sender->data('Title').' - Page '.$page);
        }
    }
    
    public function categoriesController_render_before($sender) {
        $this->discussionsController_render_before($sender);
    }
    

    But since these pages are mostly listings that change frequently, I doubt they have any SEO value.

  • Options

    @Bleistivt - thank you for the help. Would this plugin work on 2.1.10 or is it only possible in 2.2?

    Thanks again!

  • Options

    Got it working in 2.1.10 - thank you for the help!
    I got it working on the individual discussion pages as well.

    I think something similar would be really helpful on the individual comment urls like:
    https://www.websiteurl.com/forum/discussion/comment/12345/

    They end up with the same page title as the main discussion URL, and we have threads with hundreds of posts, leading to hundreds of duplicate titles.

    Is there any way to extend this to alter the titles on those pages to go from:
    Thread title - Forum Title

    To:
    Thread title - Comment 12345 - Forum Title

    ?

  • Options

    What about adding noindex, nofollow tags to the individual posts?

  • Options
    BleistivtBleistivt Moderator

    This is not needed. Every page that vanilla creates has a canonical url tag. Read more about it here: https://support.google.com/webmasters/answer/139066?hl=en

  • Options

    Is there any reference anywhere on how to hook into to different pages?

    For example, I have the same meta title on the forum home page, /discussions/, an/categories/

    Is it possible to hook into them individually and alter their page titles?

    Thanks again, I really appreciate all of your help. I'm fairly new to Vanilla - ran several vBulletin forums in the past, but this is a whole new world!

  • Options
    BleistivtBleistivt Moderator

    http://docs.vanillaforums.com/developers/plugins/quickstart/

    This is how you would change the title:

    $sender->Head->title('Your Title');
    

    This is how you would add a meta description:

    $sender->Head->addTag('meta', array(
        'name' => 'description',
        'content' => 'This is the meta description'
    ));
    

    But I believe there are SEO plugins in the addons repository that let you do that. I have personally not used any of them.

Sign In or Register to comment.