Jump to content

Duplicate Page Content

Recommended Posts

Hi all,

Hopefully this is in the correct thread!

I have unearthed a 'duplicate page content' issue on our forum whereby the page ending / is the same page as /?page=1

If that has confused you, let me try to explain a little better...

Take this forum thread;


The above URL and;


...are the same page and so create a 'duplicate page content' issue...

This I believe is affecting every forum post and so creating a vast number of errors...

Does anyone know of a fix or maybe a plugin?

Many thanks



Link to comment
Share on other sites

Hi, I noticed the same thing a while ago and did this change to a 3.4.7 install:

  1. Find file admin/applications/forums/app_class_forums.php
  2. Find line 199 or close to it
                /* Add canonical tag */
               $this->registry->getClass('output')->addCanonicalTag( ( $this->request['page'] ) ? 'showtopic=' . $topic['tid'] . '&page=' . $this->request['page'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );
  3. Replace with
               /* Add canonical page */
               # HW_CUSTOM do not add page=1 to canonical if visited with &page=1 in URL
               $this->registry->getClass('output')->addCanonicalTag( ( $this->request['page'] && $this->request['page'] != 1 ) ? 'showtopic=' . $topic['tid'] . '&page=' . $this->request['page'] : 'showtopic=' . $topic['tid'], $topic['title_seo'], 'showtopic' );

Use whatever comment you want of course, I just use HW_CUSTOM in the comment to have it easy to find any modified code I have later. 

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...