Search code examples
wordpresshttphttprequest

Disable Wordpress HTTP request for theme and plugin check update


How to Completely disable wordpress theme and plugin update check?

I'm doing some experiment with json/ajax locally and this HTTP request is slowing my workdown

I have this code below in my functions.php

add_filter( 'pre_site_transient_update_themes', create_function( '$a', "return null;" ) );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );

I also have this code in my config file

define( 'WP_AUTO_UPDATE_CORE', false );
define( 'AUTOMATIC_UPDATER_DISABLED', true );

But I can still see HTTP request on query monitor output,

If there's no HTTP request, the back-end page only takes about 0.2 sec to load, but sometimes it will have http request that will take about 8-10 seconds or even 15 seconds.

Would appreciate any help

here it took about 14 seconds https://i.sstatic.net/bNtiO.png


Solution

  • Add this code below in your wp-config file, this will block all HTTP request,

    define( 'WP_HTTP_BLOCK_EXTERNAL', TRUE );