admin管理员组文章数量:1334297
I've got a site with yoast seo running, as seen in the source:
<title>Redacted</title>
<meta name="description" content="Redacted" />
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<link rel="canonical" href="Redacted" />
<link rel="next" href="Redacted/page/2/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Redacted" />
<meta property="og:description" content="Redacted" />
<meta property="og:url" content="Redacted" />
<meta property="og:site_name" content="Redacted" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@Redacted" />
<!-- / Yoast SEO plugin. -->
However, where I have - it should actually be /index.php/page/2. That's fine, I go to fix it.
However for the life of me I can't work out where it's setting it. It's nowhere to be found in the Yoast plugin tools. I tried searching for the text across all plugins (comes up way too much to be useful).
I tried the yoast online documentation but they mostly talk about how meta tags aren't used any more, and more about what canonical and next do, rather than how or where to set them.
Any advice appreciated on how to remedy this.
I've got a site with yoast seo running, as seen in the source:
<title>Redacted</title>
<meta name="description" content="Redacted" />
<meta name="robots" content="index, follow" />
<meta name="googlebot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<meta name="bingbot" content="index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1" />
<link rel="canonical" href="Redacted" />
<link rel="next" href="Redacted/page/2/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Redacted" />
<meta property="og:description" content="Redacted" />
<meta property="og:url" content="Redacted" />
<meta property="og:site_name" content="Redacted" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@Redacted" />
<!-- / Yoast SEO plugin. -->
However, where I have - it should actually be /index.php/page/2. That's fine, I go to fix it.
However for the life of me I can't work out where it's setting it. It's nowhere to be found in the Yoast plugin tools. I tried searching for the text across all plugins (comes up way too much to be useful).
I tried the yoast online documentation but they mostly talk about how meta tags aren't used any more, and more about what canonical and next do, rather than how or where to set them.
Any advice appreciated on how to remedy this.
Share Improve this question edited Jul 12, 2020 at 13:42 mozboz 2,6281 gold badge12 silver badges23 bronze badges asked Jul 9, 2020 at 5:51 Mark MayoMark Mayo 1052 silver badges8 bronze badges1 Answer
Reset to default 1 +50In the current version of Yoast, this link is rendered by presenters/rel-next-presenter.php
, which contains this filter:
public function present() {
$output = parent::present();
if ( ! empty( $output ) ) {
/**
* Filter: 'wpseo_next_rel_link' - Allow changing link rel output by Yoast SEO.
*
* @api string $unsigned The full `<link` element.
*/
return \apply_filters( 'wpseo_next_rel_link', $output );
}
return '';
}
So, I'd suggest correcting this by implementing a filter in e.g. your functions.php
, such as:
add_filter( 'wpseo_next_rel_link', 'custom_change_wpseo_next' );
function custom_change_wpseo_next( $oldLink ) {
$new_link = 'https://example/index.php/page/2';
$link = '<link rel="next" href="'. $new_link .'" />' . PHP_EOL;
return $link;
}
Does that do it?
本文标签: Fixing link relquotnextquot in Yoast SEO for paginated links
版权声明:本文标题:Fixing link rel="next" in Yoast SEO for paginated links 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742269242a2443991.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论