Skip to content

Instantly share code, notes, and snippets.

@michaelbourne
Created November 22, 2020 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelbourne/690cd18649fab652924dc0d83ee65503 to your computer and use it in GitHub Desktop.
Save michaelbourne/690cd18649fab652924dc0d83ee65503 to your computer and use it in GitHub Desktop.
Disable Yoast's enhanced Slack sharing on pages and CPTs (non-posts)
<?php
// functions.php in a child theme
/**
* Disable Yoast's Enahnced Slack Sharing feature on non-posts
*/
function mb_disable_slack_enhancements() {
if ( 'post' !== get_post_type() ) {
add_filter( 'wpseo_output_enhanced_slack_data', '__return_false' );
}
}
add_action( 'wp', 'mb_disable_slack_enhancements' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment