Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save campusboy87/26dbd72ee19f9f6a89bb94174efd1aa9 to your computer and use it in GitHub Desktop.
Save campusboy87/26dbd72ee19f9f6a89bb94174efd1aa9 to your computer and use it in GitHub Desktop.
Removing the drop-down filter of the Rank Math SEO plugin in the table of posts
<?php
add_action( 'restrict_manage_posts', function () {
global $wp_filter;
$action = 'restrict_manage_posts';
$priority = 11;
$method = 'add_seo_filters';
if ( empty( $wp_filter[ $action ]->callbacks[ $priority ] ) ) {
return;
}
foreach ( $wp_filter[ $action ]->callbacks[ $priority ] as $name => $callback ) {
if ( str_ends_with( $name, $method ) ) {
unset ( $wp_filter[ $action ]->callbacks[ $priority ][ $name ] );
break;
}
}
}, 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment