How to Remove rel=”next” & rel=”prev” on WordPress?
14/06/2024
It is unnecessary to use the rel="next"
and rel="prev"
link tags for pagination for SEO.
If you want to remove these link tags from the source code on WordPress, you can use the codes below.
Add the codes in the functions.php file.
Remove rel=”next” & rel=”prev” for Yoast SEO
/* Remove rel="next" & rel="prev" for Yoast SEO Plugin */
add_filter( 'wpseo_next_rel_link', '__return_false' );
add_filter( 'wpseo_prev_rel_link', '__return_false' );
Remove rel=”next” & rel=”prev” for Rank Math
/* Remove rel="next" & rel="prev" for Rank Math Plugin */
add_filter( 'rank_math/frontend/disable_adjacent_rel_links', '__return_true' );
Source:
https://gist.github.com/amboutwe/66c583d2ef4015a8a244ee3e0e8cd1a0
https://support.rankmath.com/ticket/deactivate-the-link-relnext-href-tag-on-my-site/