Oxwall - 删除元标记

Oxwall - Remove meta tags

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

错误值(由 Oxwall 生成):

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

正确值:

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

提前致谢

您可以将以下行包含到您的基础或插件 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');

终于找到解决方法了

你必须这样做:

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

示例:

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

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

    函数modify_custom_meta_property(){
    OW::getDocument()->addMetaInfo('og:type', 'website', 'property');
    OW::getDocument()->addMetaInfo('og:title', 'Your awsome title here', 'property'); } OW::getEventManager()->绑定(OW_EventManager::ON_BEFORE_DOCUMENT_RENDER, 'modify_custom_meta_property');

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