gpt4 book ai didi

wordpress - 我可以删除 Yoast 添加到我的 WordPress 网站的 JSON-LD 架构吗?

转载 作者:塔克拉玛干 更新时间:2023-11-03 02:29:56 25 4
gpt4 key购买 nike

我想删除 Yoast 应用于我的 WordPress 网站的 JSON-LD 架构,以便我可以添加自己的架构。我已经添加了我自己的,Google 结构化数据测试说它没问题,但基本上我有 3 个独立的 JSON-LD 模式,而不是因为 Yoast 的两个。

你可以在这里明白我的意思:https://search.google.com/structured-data/testing-tool/u/0/#url=http%3A%2F%2Fwww.yogabearpc.com

Yoast 已经添加了 WebSite 模式,但它似乎没有必要甚至有害?

最佳答案

我想禁用它是因为站点链接搜索框以及我没有全局可用的搜索功能,仅在博客上可用。为我启用搜索框会产生不良影响。

更简单的选择可能只是阻止 Google 使用附加链接搜索框,而无需触及功能文件。您可以使用以下元数据阻止 Google 在您的网站上使用附加链接搜索框:

<meta name="google" content="nositelinkssearchbox" />

如果您想一起禁用 Yoast 的 JSON-LD,那么这里是我的博客中的一个片段和我在我的网站上使用的代码:

SOURCE

How to disable Yoast SEO Schema JSON-LD completely

function bybe_remove_yoast_json($data){
$data = array();
return $data;
}
add_filter('wpseo_json_ld_output', 'bybe_remove_yoast_json', 10, 1);

Login to your WordPress dashboard and head over to the editor within the tab menu appearance, find your functions file (normally named functions.php) and add the code below just before the PHP tag is closed at the bottom.

关于wordpress - 我可以删除 Yoast 添加到我的 WordPress 网站的 JSON-LD 架构吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38619924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com