- This topic has 7 replies, 2 voices, and was last updated 1 year, 6 months ago by Tom.
December 15, 2020 at 7:29 am #1581639The Witney SEO Guy
Quickly want to say that I’m loving using GeneratePress.
One minor issue is that I’ve enabled Infinite Scroll but I’m still getting URLs like
/blog/page/2/in the HTML.
I’d like to remove these from the HTML if possible.
Would anyone be able to provide me with the necessary code to do this?
Strategic SEO and PPC @ https://witneyseoguy.co.ukDecember 15, 2020 at 12:45 pm #1582025TomLead DeveloperLead DeveloperDecember 15, 2020 at 2:00 pm #1582078The Witney SEO Guy
It appears in the
It also appears in the post navigation section which should appear at the bottom of the page. I’m assuming this is set to
display: nonein the CSS?
You can see them in the HTML on this page: https://witneyseoguy.co.uk/blog/
Strategic SEO and PPC @ https://witneyseoguy.co.ukDecember 16, 2020 at 10:35 am #1583362TomLead DeveloperLead Developer
WordPress itself adds the
rel="next"and previous tags in
wp_head– your SEO plugin may be able to remove those?
As for the pagination – it is set to
display: none. Infinite scroll actually uses the hidden “Next” link to know where to get posts from next.December 19, 2020 at 1:12 am #1586750The Witney SEO Guy
Okay great, thanks for that. I use Yoast SEO so I’ve disabled the
rel=prevby adding the code below to functions.php:
<?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' );
I’m guessing the remaining links can’t be removed then if they’re used by infinite scroll? It would be nice if there were a way for this to work without those links being output. Any plans for development there?
Strategic SEO and PPC @ https://witneyseoguy.co.ukDecember 19, 2020 at 12:38 pm #1587432TomLead DeveloperLead DeveloperDecember 20, 2020 at 8:07 am #1588261The Witney SEO Guy
Not a huge issue, but I’d prefer the second page didn’t get linked as it’s redundant when infinite scroll is enabled.
I think I’ll just disable infinite scroll for now.
Thanks for your help.
Strategic SEO and PPC @ https://witneyseoguy.co.ukDecember 20, 2020 at 11:06 am #1588403
- You must be logged in to reply to this topic.