If you are like me, you simply want to make your software update itself automatically. I use Google Chrome because it updates itself automatically, I have my operating system set to update itself automatically, and I do the same with my website.

There is a terrific page in the WordPress codex explaining how to to setup automatic updates in WordPress. But sometimes you just want to copy and paste instead of reading. So with that in mind, just copy and paste the below code into a file in your wp-content/mu-plugins/ folder and your site will then automatically update all the things 🙂

<?php

/**
 * Update all the things!
 */
add_filter( 'allow_major_auto_core_updates', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_translation', '__return_true' );

And if you want to really go crazy, the following will force automatic updates to the latest nightlies, and it will still do automatic updates even if version control files are found (this normally disables the automatic updater). And as an added bonus, it will disable file editing so that errant users can’t modify files via the WordPress admin panel backend.

<?php

/**
 * Disable admin panel file editing.
 */
define( 'DISALLOW_FILE_EDIT', true );

/**
 * Update all the things!
 */
add_filter( 'allow_major_auto_core_updates', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_translation', '__return_true' );

/**
 * Allow core nightly updates.
 */
add_filter( 'allow_dev_auto_core_updates', '__return_true' );

/**
 * Force automatic updates even when SVN or Git folder found
 */
function always_return_false_for_vcs( $checkout, $context ) {
   return false;
}
add_filter( 'automatic_updates_is_vcs_checkout', 'always_return_false_for_vcs', 10, 2 );