1

如何删除 Oxwall 软件或任何软件中的元标记。Oxwall 核心加载自动错误的 Facebook 元标记。

错误值(由 Oxwall 生成):

<meta name="og:type" content="website" />

正确值:

<meta property="og:type" content="website" />

提前致谢

4

2 回答 2

0

您可以在基本或插件 init.php 文件中包含以下行。如果您不使用插件,请打开 /ow_system_plugins/base/init.php 并添加以下代码:

function modify_custom_meta_property(){
    OW::getDocument()->addMetaInfo('og:type', 'website', 'property');
}
OW::getEventManager()->bind(OW_EventManager::ON_BEFORE_DOCUMENT_RENDER, 'modify_custom_meta_property');
于 2020-06-28T15:13:33.180 回答
0

最后我找到了解决方案。

你必须这样做:

  1. 转到 ow_system_plugins/base/classes/event_handler.php 并在文件末尾删除或注释掉添加错误 facebook 元的所有行:

例子:

// $document->addMetaInfo("og:type", "website");

  1. 转到 /ow_system_plugins/base/init.php 并在文件顶部添加如下代码:

    function modify_custom_meta_property(){
    OW::getDocument()->addMetaInfo('og:type', 'website', 'property');
    OW::getDocument()->addMetaInfo('og:title', '你的头衔在这里', 'property'); OW::getEventManager()->bind(OW_EventManager::ON_BEFORE_DOCUMENT_RENDER, 'modify_custom_meta_property');

清除您的网站缓存并查看页面的源代码,现在应该添加正确的元数据并且错误的元数据消失了。

于 2020-07-07T17:33:54.063 回答