Unique meta description and multiple list pages
4 posts by 3 authors in: Forums > CMS Builder
Last Post: July 15, 2015 (RSS)
By JeffC - July 2, 2015
hello
I have a list page that is setup to show 6 entries per page with next and previous page links. Currently the list runs over 6 pages, and this will increase.
The meta description is currently hard coded into the html and, as a result, the meta description is duplicated 6 times. General SEO good practise suggests a unique description for each page, so I think with this set up I am loosing seo juice.
Has anyone else experienced this problem and come up with a solution. Is there a way to automatically generate text to differentiate the descriptions. For example by adding page 1, page 2, etc at the end of the hard coded description. Would this even help seo, with this solution would each description by different enough?
thanks in advance
By gregThomas - July 3, 2015
Hey Jeffncou,
What about doing something like this; at the top of the page check if there is anything set in the page request value (which is used by the getRecords function to check what page we're on). Then create a variable to store that information in:
<?php
$extendedMetaDescription = '';
if(@$_REQUEST['page']){
$extendedMetaDescription . = "Page: " . intval($_REQUEST['page']);
}
?>
Then when you load the page header and include the description meta tag, you can display the extendedMetaDescription variable after your hardcoded description.
<meta name="description" content="Description goes here. <?php echo @$extendedMetaDescription; ?>">
So if I was on page 4 of my results, the meta description would be "Description goes here. Page: 4"
Thanks,
Greg
PHP Programmer - interactivetools.com
By Deborah - July 15, 2015
Greg,
I've been wanting to achieve this same thing for a long time. Thanks for posting this solution - it works great!
I wanted to share that had to remove the space before the equals sign to make it work for me, because with the space I got a blank HTML page.
was:
$extendedMetaDescription . = "Page: " . intval($_REQUEST['page']);
now:
$extendedMetaDescription .= " (Page " . intval($_REQUEST['page']) . ")";
~ Deborah
By gregThomas - July 15, 2015
Awesome, thanks for the feedback!
PHP Programmer - interactivetools.com