Archived topic
WP Post Lists with NEXT & PREVIOUS Links
10 replies · Started by stephen on March 16, 2021
I was wondering how we change the numbered links on WP Post Lists to next and previous. I was told this is better for SEO.
Hi there,
Can you point us to the page where the list is? To check and be able to provide an appropriate approach.
You can use the private information text field to provide the site link.
https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
RingsideNews.com. We have the WP Show Lists right there on the main page.
Ah I see, you meant WP Show Posts list. Thanks.
I was wondering how we change the numbered links on WP Post Lists to next and previous. I was told this is better for SEO.
To clarify: You want the paging numbers to be removed and only keep the next and previous buttons?
Let us know.
Reminder: This should be posted on the WPSP forums here:
https://wpshowposts.com/support/area/pro-support/
We currently don't have previous and next buttons. We have numbers. I would like to make these previous and next buttons. We are displaying currently using your guys WP Show Lists plugin.
We currently don’t have previous and next buttons. We have numbers. I would like to make these previous and next buttons. We are displaying currently using your guys WP Show Lists plugin.
I'm not sure I see what you mean.
I've checked your site and the next and previous buttons are displaying as shown here:
https://share.getcloudapp.com/5zuAx0xP
If you meant the "previous" button only. It doesn't show on the first page of the pagination as there's no previous page to go to. The same goes for "next" when you're in the last page.
There also appears to be additional issues with WP Show Posts and "canonical" options. Basically, when you set pagination on, and you go to page two, no "canonical" options for page 2, 3, 4, ect are being created within Yoast SEO. All the "canonical" URL are pointing back to the main page of the domain, which is not correct.
When using default archive/display all posts on the main page, the "canonical" works just fine. It just doens't work with WP Show Posts and Generatepress. This is very bad for SEO.
Any way to fix this?
What I am saying is that we don't want those numbers there. Is there a way to remove them and just have it say "Next" and "Previous"
I was able to get rid of the numbers via CSS. But there is still a major issue.
There also appears to be additional issues with WP Show Posts and “canonical” options. Basically, when you set pagination on, and you go to page two, no “canonical” options for page 2, 3, 4, ect are being created within Yoast SEO. All the “canonical” URL are pointing back to the main page of the domain, which is not correct.
Any idea on how to fix this? Ideally when "pagination" is enabled, you would want the "canonical" to display on page 2 to point to page 2. By default, it's pointing to the homepage.
this here is somewhat the issue we have.
The main issue here is that WP Show Posts is meant for a simple list of posts. While pagination is possible, it can cause issues if you're expecting the page to act as an archive page with canonical links. This would require a custom solution to be added that the plugin simply isn't able to do by default on static pages.
As for the next/previous links, you'll need to hook them into the list:
add_action( 'wpsp_after_wrapper', function( $settings ) {
if ( 123 === (int) $settings['list_id'] ) {
next_posts_link( __( 'Older posts' ) );
previous_posts_link( __( 'Newer posts' ) );
}
} );