When the homepage is broken into multiple pages, Yoast SEO adds a prev/next links so search engines understand how each paginated subpage relates to each other.
You or your developer can use the wpseo_next_rel_link
and wpseo_prev_rel_link
filter to customize this feature.
An example code snippet can be found here:
https://gist.github.com/amboutwe/66c583d2ef4015a8a244ee3e0e8cd1a0
Typically code snippets are added to your theme’s functions.php file. If you’re not familiar with using code snippets, these articles have wonderful advice:
http://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/
http://www.wpbeginner.com/beginners-guide/beginners-guide-to-pasting-snippets-from-the-web-into-wordpress/
This thread has been marked as resolved due to lack of activity.
You’re always welcome to re-open this topic. Please read this post before opening a new request.
Thanks for understanding!
Thread Starter
bgfr
(@bgfr)
HI, Just a quick question in relation to that topic. On the bottom of theme functions.php
I added this piece of code:
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Yoast SEO Prev/Next URL from all pages
* Credit: Yoast Team
* Last Tested: Jun 10 2017 using Yoast SEO 4.9 on WordPress 4.8
*/
add_filter( 'wpseo_next_rel_link', '__return_false' );
add_filter( 'wpseo_prev_rel_link', '__return_false' );
The filters worked fine but they removed the <link rel="next" href="website/page/2/" />
from home page and <link rel="next" href="website/page/3/" />
from page 2 and so on, but recently i found out that all pages still exist. All pages page/2/, page/3/ up to page/43/
Was this the expected outcome or i did something wrong?