Block All in One SEO from altering site title

The new version of AIOSP( v3.0 ) is altering site title forcibly and doing anything in the theme does not block it to do so ! How to prevent it from this stupid behavior ?

Topic plugin-all-in-one-seo Wordpress

Category Web


Here is the solution to completely remove it's title filter First disable "force rewrites" in "performance" Then add this code to theme "functions.php"

add_action( 'template_redirect', 'remove_aioseo_wp_title', 1 );
function remove_aioseo_wp_title() {
    global $aiosp;

    if( isset( $aiosp ) ) {
        remove_filter( 'wp_title', array( $aiosp, 'wp_title' ), 20 );
    }
}

Edit: This is the new code for v4.0

add_action( 'wp', 'remove_aioseo_wp_title', 0 );
function remove_aioseo_wp_title() {

    if( ! function_exists( 'aioseo' ) ) {
        return;
    }

    $aioseo = aioseo();
    remove_action( 'wp', array( $aioseo->head, 'registerTitleHooks' ), 1000 );
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.