Mister Denial Posted September 18, 2012 Share Posted September 18, 2012 (edited) Hi folks, there is a fix by Presto-Changeo out to fix the duplicate meta title issue by adding a number for the titel for subsequent category pages. Is it possible to extend that to the meta description? Like having "blah blah blah" as description on page 1, and "blah blah blah - page 2" for the next page, and so on? I currently am facing the issue that Google ignores the dissallow: p= instruction from robots.txt and I have a load of duplicate warnings I can't get rid of. Help would be much appreciated. Dan Edited November 19, 2012 by Mister Denial (see edit history) 1 Link to comment Share on other sites More sharing options...
viktor123 Posted September 28, 2012 Share Posted September 28, 2012 Hi, I tried to find a quick solution to the problem. add this function to Page class. public function custom_page_number() { $page_number = substr($_SERVER['REQUEST_URI'],-2); $page_number = trim($page_number,"="); $page_number = preg_replace('#[^0-9]#','',strip_tags($page_number)); $page_number = trim($page_number); if(strlen($page_number) > 0) return "results ".$page_number; else return $page_number; } it takes the last 2 characters from the url where it says ?p=2 (for page 2), and cleans the "=". Then if you are on page 1, returns empty string, if you are in page > 1, it returns "results 2,3...". You can call this function everywhere, like Page::custom_page_number() and you will avoid duplicate meta description or title, etc.. ex: in header.tpl in your theme folder, add the following code <meta name="description" content="{$meta_description|escape:html:'UTF-8'} {Page::custom_page_number()|escape:html:'UTF-8'}" /> 1 Link to comment Share on other sites More sharing options...
Phil_Malaysia Posted October 3, 2012 Share Posted October 3, 2012 (edited) I read the post and am wondering if anyone has tried this? I'm using Prestashop v1.4.8 and would like to also reduce my duplicate content. I shall give the above code a try and post my results. Phil Kids Toys (Malaysia) Edited October 3, 2012 by Phil_Malaysia (see edit history) Link to comment Share on other sites More sharing options...
marcos223 Posted October 20, 2012 Share Posted October 20, 2012 just tried and works perfect! thanks Link to comment Share on other sites More sharing options...
Mister Denial Posted November 19, 2012 Author Share Posted November 19, 2012 Thanks everyone for their help, works perfectly! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now