Show only the first 20 keywords in the meta keywords (v. 2.81)
If you would like to add many keywords (for better searching), but only show the first 20 keywords in the Meta Keywords:
-
Open the openinfo.php file in the /enc/ folder.
-
Almost at the bottom of the file, find the line:
$Meta_Description = substr(strip_tags(str_replace("", " ", stripslashes($Meta_Description))), 0, 500); -
Just under that line, add the code:
$metakeywords=explode(",", str_replace(", ", ",", $Meta_Keywords), 21); $Meta_Keywords=implode(", ", array_splice($metakeywords, 0, 20)); -
Save and reload the file.
Note: To show a different number of keywords, change the 20 and 21 (one more than 20). For instance, if you'd like to show the first five keywords, you would use:
$metakeywords=explode(",", str_replace(", ", ",", $Meta_Keywords), 6);
$Meta_Keywords=implode(", ", array_splice($metakeywords, 0, 5));