-
AuthorPosts
-
November 3, 2017 at 11:37 pm #872333
Hi!
I can’t get Yoast to generate meta content rel=”next” and rel=”prev” on pages that are paginated (news posts)…
It is supposed to work automatically, but I guess there’s a conflict with the theme.it should have this in the header:
<link rel=”canonical” href=”https://website.com/page/3/” />
<link rel=”prev” href=”https://website.com/page/2/” />
<link rel=”next” href=”https://website.com/page/4/” />I found this : https://kb.yoast.com/kb/is-the-plugin-compatible-with-paginated-content/
but need for not only the home page…Can anyone help me on this?
Thank you,
MelanieNovember 6, 2017 at 3:56 pm #873113Hey Melanie,
Your front page is built with the Advanced Layout Builder and so there are no buttons there. The only ones that I see are on the slider in the team section. These are not the ones where Yoast sea can add any code to.
Are these the buttons that you mean?Best regards,
VictoriaNovember 6, 2017 at 4:24 pm #873131Hi!
I am not talking about any buttons…
The pagination content is in the post hidden header
go https://new.octanestrategies.com/en/news/page/2/
and view page source of pageI should see:
<link rel=”canonical” href=”https://new.octanestrategies.com/en/news/page/2/” />
<link rel=”prev” href=”https://new.octanestrategies.com/en/news/” />
<link rel=”next” href=”https://new.octanestrategies.com/en/news/page/3/” />but the last 2 are not showing…
It is not showing although the SEO plugins is installed. It should work automatically.
https://webmasters.googleblog.com/2011/09/pagination-with-relnext-and-relprev.htmlThanks
MelanieNovember 8, 2017 at 5:10 am #873990Hi,
You can add it manually by using the following hook.
add_action('wp_head', 'wp_head_pagination_mod'); function wp_head_pagination_mod() { $page = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : get_query_var( 'page' ); if( ! $page ) return; $url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = substr($url, 0, strpos($url, "page")); $link_prev = $url . 'page/' . ($page - 1); $link_next = $url . 'page/' . ($page + 1); $output = ' <link rel="prev" href="'. $link_prev .'" />' . PHP_EOL; $output .= ' <link rel="next" href="'. $link_next .'" />' . PHP_EOL; echo $output; }
Best regards,
IsmaelMarch 8, 2018 at 7:48 pm #924014Hi Ismael, i have the same problem, tried code you posted but it does not work. So now in Google search results i see also page 2 and 3 of the homepage where are listed all the articles: http://www.mysite.it/page/2 and http://www.mysite.it/page/3. I opened source html page but there are not
<link rel=”prev” href=”http://www.mysite.it/page/2/” /> and <link rel=”prev” href=”http://www.mysite.it/page/3/” />. Thanks for your help.March 9, 2018 at 10:31 am #924379Hi,
I can see the link tag with the rel attribute in the page’s source code.
<link rel="prev" href="http://www.progettobenesserecompleto.it/page/1" />
Best regards,
IsmaelMarch 9, 2018 at 12:40 pm #924453Ismael, where in the source code? I can’t see it.
Thanks
March 10, 2018 at 12:33 am #924799[URGENT] I had to remove code in functions.php because it disabled all pagination links (and i get 404 error). Pagination links are in the homepage and in the articles page.
Now pagination links in the homepage works again but that ones in the articles page (see private content) not anymore (pag 2 and 3).
Articles contains same articles element of the homepage (so same pagination links).
What i have done:
– Deactivated Plugin SEO Yoast
– Remove articles element from the homepage.But neither of those things worked.
Enfold version: 4.2.6; wordpress: 4.9.4.
How can i fix the issues?
Thanks.
- This reply was modified 6 years, 8 months ago by maryhellensegatta.
March 12, 2018 at 12:14 am #925305Ismael, i found what caused the error. If you activate “Remove the categories prefix” in the Yoast seo settings (under taxonomies, the last one), everything works again. You can mark as resolved.
March 14, 2018 at 7:16 am #926442 -
AuthorPosts
- The topic ‘Paginated pages not showing rel=”next” and rel=”prev”’ is closed to new replies.