[TUTORIAL] Shutting up stupid YOAST intrusions

Posted in: Newspaper
Post count: 9544

If you’re like me, some of Yoast’s bloat is now bordering on the point we may stop using it very soon.

Latest thing is adding new user roles for SEO editors, whether you want them or not (man, the Yoast people are clueless aren’t they .. everything is ‘on’ by default, polluting your dbase…)

Anyway — to disable the new Yoast ‘seo editor’ user types, add this to your functions.php or personal hack plugin or whatver

if ( get_role('wpseo_manager') ) {
remove_role( 'wpseo_manager' );
}

if ( get_role('wpseo_editor') ) {
remove_role( 'wpseo_editor' );
}

as with all things make backups first ….

my old ‘dequeue yoast css’ — and remove one element we never use

function mytheme_admin_bar_render() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wpseo-menu');
}
add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' );
add_filter( 'wpseo_use_page_analysis', '__return_false' );

function my_custom_css() {
echo '<style>
.misc-pub-section.yoast-seo-score.content-score { display: none; }
.misc-pub-section.yoast-seo-score.keyword-score { display: none; }
</style>';
}
add_action( 'admin_head', 'my_custom_css' );

function dequeue_yoast_css() {
wp_dequeue_style('yoast-seo-adminbar');
wp_deregister_style('yoast-seo-adminbar');
}
add_action('wp_enqueue_scripts','dequeue_yoast_css');

Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.