Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active October 30, 2021 19:55
Show Gist options
  • Save KaineLabs/ba4d12b960454106c98c5d266d10752a to your computer and use it in GitHub Desktop.
Save KaineLabs/ba4d12b960454106c98c5d266d10752a to your computer and use it in GitHub Desktop.
Youzify - BuddyPress Remove Yoast Meta Tags
<?php
/**
* Remove Yoast Meta Tags in profiles and groups pages.
*/
function remove_all_wpseo_og() {
if ( bp_is_user() || bp_is_group() ) {
$front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
}
}
add_action( 'wp_head', 'remove_all_wpseo_og', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment