Avoid Duplicate title tags in pagination of Rank math
-
Hi,
We are migrating from Yoast plugin to Rank Math plugin recently in our site, after that the below code which written for duplicate title tag for pagination pages not working in Rank Math which is previously working in Yoast. Now in Rank Math all the paginated pages has same title without page number in the end.
Example: The below code adds “| page 2” in the end of title in Yoast Plugin.
Code:
function blog_multipage_title($title)
{
global $page;
$paged = get_query_var(‘paged’) ? get_query_var(‘paged’) : 1;
!empty($page) && 1 < $page && $paged = $page;
$paged > 1 && $title .= ‘ | ‘ . sprintf( __(‘Page %s’), $paged );
return $title;
}
add_filter(‘wpseo_title’, ‘blog_multipage_title’,100,1);
Can you please provide solution for this to avoid duplicate title tags for pagination in Rank Math.
Thanks!
Bharathi Viswa.
- The topic ‘Avoid Duplicate title tags in pagination of Rank math’ is closed to new replies.