Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

WordPress automatically checks for updates to itself and all installed themes and plugins. This adds an annoyingly long delay to loading (any) WordPress pages. In only happens once per day and subsequent page-loads don’t do it, but it is so long, that it makes me think twice about whether it is worth opening that first page at all (especially if I only need to do a quick thing rather than spending all day in WordPress).

I only update once in a while anyway, and would much rather perform updates manually anyway, so I created a plugin to remove the Updates button from the admin bar. I thought that would do the trick, but apparently in only removes the button and the actual check is still performed in the background.

Every other program in the world lets you turn them off automatic updates, so I expect that there should be a way to do the same for WordPress, but if there is, it is a little too-well—hidden.

When I tried to find a solution, all of the questions that came up were the opposite, about finding a way to force automatic updates to actually apply (not just automatically check for updates).

How can automatic update checks be turned off in WordPress?

share|improve this question
    
Have you read this? –  toscho Jun 10 '13 at 18:49
    
Also see the update here wordpress.stackexchange.com/questions/67945/… , it causes a PHP warning but I forget why. –  Wyck Jun 10 '13 at 19:03
    
Also, review instructions of this WP codex: codex.wordpress.org/Configuring_Automatic_Background_Updates –  Tara Jan 24 at 1:16
    
related question: wordpress.stackexchange.com/questions/120081/… –  Tara Mar 27 at 20:31
    
The information about automatic background updates in 3.7 weren’t what I was talking about (I’m still using 3.5—I’m avoiding updating until the post formats thing is sorted out because I often want to post just a single photo or sentence, not a whole post). However, the question about dashboard update notifications is definitely related. When I get my portable web-server up and running again, I’ll test that. –  Synetech Mar 28 at 1:40
add comment

2 Answers

Add define('DISALLOW_FILE_MODS',true); to your wp-config file. Note: this will also disable explicit check for updates.

share|improve this answer
    
How have you got the impression that this will work? Btw: There's formatting for code in the WYSIWYG editor. –  kaiser Jun 10 '13 at 21:15
    
I'm pretty sure this is role based via map_meta_cap so it still checks for updates it just won't show them. –  Wyck Jun 10 '13 at 21:32
    
Test it if you don't believe it. –  Frank P. Walentynowicz Jun 10 '13 at 21:59
1  
I did test it, and I have to side with @kaiser and @Wyck. The core does still try to check for updates with define('DISALLOW_FILE_MODS',true); –  s_ha_dum Jun 10 '13 at 23:47
    
Reason for that: It's just meant to deactivate the Theme and Plugin Editors in the admin UI. And just to explain why I know it's not working: I got it deactivated per default in every single of my installs including the local one. –  kaiser Jun 11 '13 at 0:21
show 1 more comment

Mark Jarquith already posted about this on his blog a while ago. Basically it just bails requests to the public SVN repos on wp dot org via the WP HTTP API filters.

For Plugins (must get placed inside the plugin):

add_filter( 'http_request_args', 'wpse_102554_deny_plugin_updates', 5, 2 );
function wpse_102554_deny_plugin_updates( $r, $url )
{
    if ( 0 !== strpos( $url, 'http://api.wordpress.org/plugins/update-check' ) )
        return $r;

    $plugins = unserialize( $r['body']['plugins'] );
    unset(
        $plugins->plugins[ plugin_basename( __FILE__ ) ],
        $plugins->active[ array_search( plugin_basename( __FILE__ ), $plugins->active ) ]
    );
    $r['body']['plugins'] = serialize( $plugins );

    return $r;
}

For Themes (must be placed inside functions.php of the theme and only works for the currently active theme):

add_filter( 'http_request_args', 'wpse_102554_deny_theme_updates', 5, 2 );
function wpse_102554_deny_theme_updates( $r, $url )
{
    if ( 0 !== strpos( $url, 'http://api.wordpress.org/themes/update-check' ) )
        return $r;

    $themes = unserialize( $r['body']['themes'] );
    unset(
        $themes[ get_option( 'template' ) ],
        $themes[ get_option( 'stylesheet' ) ]
    );
    $r['body']['themes'] = serialize( $themes );

    return $r;
}

John Blackburn has written a plugin to disable theme updates.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.