• Resolved Rongo

    (@rongo)


    Just wondeirng if there’s a switch I can use in wp-config to turn off the emails that are sent every time there’s a new WordPress release?

    As the admin of several thousand sites for clients, receiving an email for every site every time there’s an update or a patch is redundant, at best. Since 5.0 and 5.01, I’ve received a little more than 6,000 emails.

    I don’t need the emails. We download a fresh copy of WordPress to our own central private repo every night and then roll them out ourselves.

    I know there’s plugins to do it, but I don’t want to add another plugin for something that should be as simple as toggling emails on or off.

    I’ve checked the Codex for a possible directive in wp-config, but to no avail.:
    https://codex.www.ads-software.com/Editing_wp-config.php

    Surely there must be an easy toggle directive to stop the emails?

    Thanks in advance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Can you make changes to functions.php? If so, you can try this.

    add_filter( 'auto_core_update_send_email', '__return_false' );

    • This reply was modified 5 years, 11 months ago by JanrikV.
    Thread Starter Rongo

    (@rongo)

    Thanks. I don’t want to rely on theme functions as themes change among clients. Which means I have to add a functions.php edit for every theme activated or tried.

    There has to be a simple means of toggling email notices wordpress updates on or off, and the most logical place would be a directive in wp-config.

    An hopeful for a wp-config directive.

    You can add add_filter in wp-config.php, but it is not recommended.

    Thread Starter Rongo

    (@rongo)

    Thanks, but you’re right, adding filters in wp-config is not ideal. I’m hoping there is an actual directive to toggle it on/off, not unlike toggling automatic-updates on/off. The idea of using a plugin for something that should be a simple true/false directive is not exactly appetizing.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    You can’t add a filter in wp-config.php, actually. It won’t work from there.

    The best you can do is to make a mu-plugin and add it to a PHP file there.

    In wp-content, make a subdirectory called mu-plugins. It should be right alongside the plugins and themes directories.

    Mu plugins are “must use”. WordPress auto-loads them. So make a new PHP file in there and put this in it:

    <?php
    /*
     * Plugin Name: Turn off Update Emails 
     */
    
    add_filter( 'auto_core_update_send_email', '__return_false' );
    

    Save it and you’re done.

    Thread Starter Rongo

    (@rongo)

    Samuel, thanks.

    Hmm, so in the end, WP does not provide a directive to be added to the wp-config file?

    Example:

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

    Does that not seem logical to place it with other similar directives governing “update” functionlity?

    I’d MUCH rather have a fixed directive than a plugin to alter core functionality.

    • This reply was modified 5 years, 11 months ago by Rongo.
    • This reply was modified 5 years, 11 months ago by Rongo.
    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Yeah, sorry. It’s a filter, not a define. So no such option exists for a define there.

    Realistically, it’s one line of code. You don’t need to think of it as “yet another plugin”. Plugins are not inherently bad. The amount of code that you’re running is all that matters, not the number of plugins.

    Thread Starter Rongo

    (@rongo)

    Thanks. And yes, understood that it’s just one line of code. Would have just been nice (and logical), to have some consistency in the wp-config as it pertains to auto upgrade functionality, since it is related.

    I’ll go ahead and use the plugin option. Perhaps at some point the Devs will expand the directives available to wp-config, especially ones related to core functionality and/or behaviour.

    Thanks again.

    • This reply was modified 5 years, 11 months ago by Rongo.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WP-Config – Disabling Update Notices. Is it Possible?’ is closed to new replies.