如何删除 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');
最后我找到了解决方案。
你必须这样做:
例子:
// $document->addMetaInfo("og:type", "website");
转到 /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');
清除您的网站缓存并查看页面的源代码,现在应该添加正确的元数据并且错误的元数据消失了。