Created
February 4, 2025 14:36
-
-
Save wp-seopress/bedc38b5a0afc07b16371423186f4531 to your computer and use it in GitHub Desktop.
Filter rel next/prev link in head of paginated archive pages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sp_titles_paged_rel($html, $paged) { | |
$html = ''; | |
if ($paged) { | |
$html .= '<link rel="prev" href="' . get_pagenum_link($paged - 1) . '">'; | |
$html .= '<link rel="next" href="' . get_pagenum_link($paged + 1) . '">'; | |
} | |
return $html; | |
} | |
add_filter('seopress_titles_paged_rel', 'sp_titles_paged_rel', 9, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment