Hi @iamwpuser
OpenGraph has a limited list of supported og:locale designations. If your locale is not in this list, our plugin will output the best match for your language.
You can follow developer blog to find an example code and the list of supported og:locale tag.
So if I can not edite ru-ru, I have to delite this string <meta property=”og:locale” content=”ru_RU” class=”yoast-seo-meta-tag” />
I can use only ru or ru-ua, ru-ru hurts my site’s search engine visibility!
HOW CAN I DELETE THIS STRING
<meta property="og:locale" content="ru_RU" class="yoast-seo-meta-tag" />
???????????????????????????????????????????????????????????
also I have tried this:
add_filter( ‘wpseo_locale’, function( $locale ) {
// Убираем вывод тега
return ”;
} );
and this:
add_action( ‘wpseo_head’, function() {
// Удаляем вывод тега
ob_start(function($output){
return preg_replace(‘/]+>/i’, ”, $output);
});
}, 9999 );
Not helps, can anybody help?
ok,ok, I have deleted <meta property=”og:locale” content=”ru_RU” class=”yoast-seo-meta-tag” /> with
function remove_locale_presenter( $presenters ) {
return array_filter( $presenters, function( $presenter ) {
// Удаляем Locale_Presenter, чтобы он не выводил
return ! ( $presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Presenter );
});
}
add_filter( ‘wpseo_frontend_presenters’, ‘remove_locale_presenter’ );
But I can not delete this string in the same way
<meta property="og:locale:alternate" content="ru_RU" />
HOW TO DELETE THIS og:locale:alternate STRING?
-
This reply was modified 1 year, 6 months ago by
iamwpuser.
this
function remove_locale_and_alternate_presenters( $presenters ) {
return array_filter( $presenters, function( $presenter ) {
// Удаляем Locale_Presenter и Locale_Alternate_Presenter
return ! ( $presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Presenter ||
$presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Alternate_Presenter );
});
}
add_filter( ‘wpseo_frontend_presenters’, ‘remove_locale_and_alternate_presenters’ );
and this
function remove_locale_and_alternate_presenters( $presenters ) {
return array_filter( $presenters, function( $presenter ) {
// Удаляем Locale_Presenter и Locale_Alternate_Presenter
return ! ( $presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Presenter ||
$presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Alternate_Presenter );
});
}
add_filter( ‘wpseo_frontend_presenters’, ‘remove_locale_and_alternate_presenters’ );
and this
function remove_yoast_og_locale_alternate( $presenters ) {
return array_filter( $presenters, function( $presenter ) {
// Убираем не только Locale_Presenter, но и Locale_Alternate_Presenter
if ( $presenter instanceof Yoast\WP\SEO\Presenters\Open_Graph\Locale_Alternate_Presenter ) {
return false;
}
return true;
});
}
add_filter( ‘wpseo_frontend_presenters’, ‘remove_yoast_og_locale_alternate’ );
NOT HELPS, DO YOU KNOW HOW?
Hi @iamwpuser
I understand you are trying to remove og:locale:alternate property from page source. Unfortunately, there is no specific filter to remove the og:locale:alternate property.
This will require custom code. Unfortunately we can’t offer support on custom code. Since we don’t want to take the risk that we break your website by suggesting incorrect or incomplete code, we cannot advise you on how to make such changes.
Feature request:
Thank you for suggesting a new feature for one of our plugins! You’re not the first to have requested this feature! That means a feature request has been created internally and is under review by our product team.
What’s next?
Our product team will assess the feature request and assign a priority level to the report. Our developers work on the highest priority issues first. We cannot give you an estimate of when or if they’ll start working on the request.
If you have any further information that may affect the prioritization, please feel invited to reply to this forum topic, and we’ll share the information with our product team.