On my proddetail.php page I have <meta name="Description" content="<?php print str_replace('"','"',$productdescription)?>">, but I've noticed that this produces a very long meta description when product descriptions have a lot of text. Is there a way to limit the number of characters in the meta tag?
I'm sure it's easy and something like I use for .asp <meta name="Description" content="<%if productdescription<>"" then response.write(Left(productdescription,165)) end if %>"/>
I'll see if I can get you a .php version of that.
***edit - https://www.w3schools.com/php/func_string_substr.asp That should get you on track. Let me know if you need help.
Hi Richard, it seems Google has been back and forth in the last year about how many characters it reads from meta description, but latest info suggests it's around 170 characters. Although I must admit I am not sure about the other less popular se's.