mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-02 12:02:25 +08:00
12 lines
403 B
Text
12 lines
403 B
Text
add_action( 'template_redirect', 'remove_wpseo' );
|
|
|
|
/**
|
|
* Removes output from Yoast SEO on the frontend for a specific post, page or custom post type.
|
|
*/
|
|
function remove_wpseo() {
|
|
if ( is_single ( 1 ) ) {
|
|
$front_end = YoastSEO()->classes->get( Yoast\WP\SEO\Integrations\Front_End_Integration::class );
|
|
|
|
remove_action( 'wpseo_head', [ $front_end, 'present_head' ], -9999 );
|
|
}
|
|
}
|