- This topic has 7 replies, 2 voices, and was last updated 1 year, 6 months ago by
Tom.
-
AuthorPosts
-
December 15, 2020 at 7:29 am #1581639
The 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?
Thanks
Strategic SEO and PPC @ https://witneyseoguy.co.uk
December 15, 2020 at 12:45 pm #1582025Tom
Lead DeveloperLead DeveloperHi there,
Where in the HTML are you seeing those URLs?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 15, 2020 at 2:00 pm #1582078The Witney SEO Guy
It appears in the
rel=next
andrel=prev
attributes.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: none
in the CSS?You can see them in the HTML on this page: https://witneyseoguy.co.uk/blog/
Strategic SEO and PPC @ https://witneyseoguy.co.uk
December 16, 2020 at 10:35 am #1583362Tom
Lead DeveloperLead DeveloperWordPress itself adds the
rel="next"
and previous tags inwp_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.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 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=next
andrel=prev
by 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.uk
December 19, 2020 at 12:38 pm #1587432Tom
Lead DeveloperLead DeveloperIt hasn’t really come up before. Is there an issue with having the pagination set to
display: none
?Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentDecember 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.uk
December 20, 2020 at 11:06 am #1588403Tom
Lead DeveloperLead DeveloperNo problem!
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.