You are here: Home

Fixing duplicate meta descriptions in Kunena forum posts for SEO benefit

Wednesday, 23 May 2012 17:45 Written by  Ed
Rate this item
(0 votes)

It is common knowledge that having duplicate meta descriptions for different page in your website can harm your SEO efforts. If you are using the Kunena forum component for Joomla! you may have noticed this can create duplicate meta descriptions that will appear in Google Webmaster tools.

One way of getting round this problem is to append page numbers to each new forum post thereby making them unique.

In Kunena 1.7.2 the meta descriptions for each forum post are created in the file


Look at the code below from the view.php file :

               // Create Meta Description form the content of the first message

               // better for search results display but NOT for search ranking!

               $metaDesc = KunenaParser::stripBBCode($this->first_message->message);

               $metaDesc = strip_tags($metaDesc); // Now remove all tags

               $metaDesc = preg_replace('/\s+/', ' ', $metaDesc); // remove newlines

$metaDesc = preg_replace('/^[^\w0-9]+/', '', $metaDesc); // remove characters at the beginning that are not letters or numbers

               $metaDesc = trim($metaDesc); // Remove trailing spaces and beginning

We could manipulate the code here to append a page number to this meta description to make it unique. Code below:

$page = 0;

if ($limit) {

$page = ($limitstart / $limit) + 1;


if ($page>1) {

    $metaDesc=' Page ' . $page. $metaDesc;

} else {


This will should append page numbers to the beginning of each new forum post.

Last modified on Wednesday, 05 December 2012 09:57



  • Comment Link Ambar Thursday, 27 September 2012 15:24 posted by Ambar

    very nice and informative post.. Yes with those settings It will help in SEO Improvements for blogs

  • Comment Link Freddy Tuesday, 30 October 2012 04:01 posted by Freddy

    excellent, thanks for posting this solution.
    Best Regards

Leave a comment

Make sure you enter the (*) required information where indicated.
Basic HTML code is allowed.

Latest from our blog