We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Duplicate meta tags [Answered] | Forum

Saif
Saif Mar 23 '13
Today I checked my site on Google web master and I was shocked to see over 1300 duplicate meta tags, what could be the reason ? How do i correct it ?



The Forum post is edited by Alia May 28 '13
ben
ben Mar 23 '13
good question, I also looking for this solution
Alia Team
Alia Mar 25 '13
Saif, thank you for reporting.
We will check what can be done. Since this is not a major/critical issue, we solve this in one of the  upcoming builds.
Saif
Saif May 25 '13
I hope this will be covered in OX 1.6
dave Leader
dave May 25 '13

I will see what i can do in the mean time as a temp fix.   Even with adding special meta tag in the settings area we are still left with this on page source..

 

<meta name="keywords" content="openwack, free software, open source software, community software, open source community software, free community software, open source social networking software, free social networking software, php, mysql" /> 

 

And that is not quite fair to the owner of the site.  I will look into a temp fix and update this post.

The Forum post is edited by dave May 25 '13
dave Leader
dave May 25 '13

This should be a temp fix for the meta keyword dups..

 

open ow_core/application.php 

 

about half way down the page you will see this code:

 

if ( $document->getKeywords() === null )
{

 $document->setKeywords($language->text('nav', 'page_default_keywords'));

 }


Change it to show this:

 

if ( $document->getKeywords() === null )
        {

          //added to make meta keywords random


           //you can change these array element keyword names to what you want

           // be sure you use enough (min 20) keywords so we get a good random cycle. 
         

           //these are my keywords to test this, you need to change these


           $mykwarr = array("anorexia","dating","eating disorder social","online social","online dating","anorexia support","anorexia love","anorexia romance","anorexia dating","anorexia making love","anorexia community","eating disorder community","eating disorder dating","eating disorder romance","romance","mingle","find match","share photos","chatroom","blogs");  //20 keywords

 

           //we are displaying 5 keywords each time, which is a good mix

 

           $myrandom_keyword = array_rand(array_flip($mykwarr),5);
           $document->setKeywords($myrandom_keyword);

 

            // orig code commented out
           // $document->setKeywords($language->text('nav', 'page_default_keywords'));

 

        }//close if get keyword null

 

 

save and refresh your page.. :)

 

The Forum post is edited by dave May 25 '13
Saif
Saif May 25 '13
It gives following error


Parse error: syntax error, unexpected T_STRING in /home/*****/public_html/ow_core/application.php on line 403


May be I put put something wrong

The Forum post is edited by Saif May 25 '13
dave Leader
dave May 25 '13
yes because i copied that directly from mine, and mine works perfect.    Copy and paste yours here or PM me with it and i can tell you.
The Forum post is edited by dave May 25 '13
dave Leader
dave May 25 '13
I assume you found the problem and this works for you now :)
Saif
Saif May 26 '13
I replaced this 

if ( $document->getKeywords() === null )
{

 $document->setKeywords($language->text('nav', 'page_default_keywords'));

 }


With this


if ( $document->getKeywords() === null )

{

 $document->setKeywords($language->text('nav', 'page_default_keywords'));

 }


Change it to show this:

 

if ( $document->getKeywords() === null )

        {

           


           $mykwarr = array("Bazm-e-Urdu","Urdu Social Network","Urdu Forum","Urdu Blogs","Urdu Poetry","Urdu Font","Allama Iqbal Poetry","Urdu Shairy Ghazal","Urdu Books Free Download","بزم اردو سوشل نیٹورک","اردو شاعری","اردو محفل کہانیاں ","اردو فورم","Urdu Islamic books","مفت اردو کتابیں","Urdu Writers and poets forum","اردو ویڈیو تصاویر","share photos","chatroom","blogs");  //20 keywords

 

          

           $myrandom_keyword = array_rand(array_flip($mykwarr),5);

           $document->setKeywords($myrandom_keyword);

  

        }

 

Quote from dave if ( $document->getKeywords() === null ) {  $document->setKeywords($language->text('nav', 'page_default_keywords'));  }

Still getting same error :(

Saif
Saif May 26 '13
My Foolishness I didn`t remove these lines... Solved  Now :P


Quote from Saif if ( $document->getKeywords() === null ) {  $document->setKeywords($language->text('nav', 'page_default_keywords'));  } Change it to show this: