Rabu, 29 Januari 2014

Menonaktifkan Auto Update Wordpress

Menonaktifkan Auto Update Wordpress

Sejak saya pakai Wordpress versi 3.8 saya beberapa kali mendapatkan email bahwa situs telah update menggunakan versi terbaru. Wordpress memang skrip yang terlalu sering melakukan update versi. Baru juga pasang di situs, eh sudah muncul notifikasi versi terbaru sudah tersedia, kemudian menyuruh please update.

Fitur auto update mungkin bagus. Namun saat ini saya tidak mau menggunakannya pada situs saya. Update core skrip wordpress belum tentu diiringi dengan plugin-nya. Bagaimana kalau nanti malah tidak kompatibel antara core dan plugin yang saya gunakan? Malah berabe.

Untuk menonaktifkan fitur auto update, ada beberapa pilihan. Tambahkan baris kode ini di wp-config.php. Silakan pilih saja mana yang disukai.

How to enable major release updates

If you want the WordPress auto updates to handle major core updates too, you will have to add a single configuration line. To do this, open the wp-config.php file in the root folder of your WordPress installation and add this line to it:

define('WP_AUTO_UPDATE_CORE', true);

How to enable plugins updates

If you want your plugins to be automatically updated by WordPress when a new version is released, you need to add a line to your wp-config.php file, similar to the one above. This time, however, a filter is used for enabling the plugin auto updates:

add_filter( 'auto_update_plugin', '__return_true' );

How to enable themes updates

If you want WordPress to handle themes updates you need another line added to the wp-config.php file:

add_filter( 'auto_update_theme', '__return_true' );

NoteThis will work only if your theme is downloaded from the official WordPress repository. If you're using a paid theme for example, or you've downloaded your theme from a designer's website it will not update automatically when new version is released.

How to disable core auto updates but enable plugins and themes auto updates

If you want to stop the autoupdates of the WordPress core, but to enable them for your Plugins and/or Themes, you can add these lines in the wp-config.php file:

Stop the core auto updates:
 
define( 'WP_AUTO_UPDATE_CORE', false );

Then Enable the plugins/themes:
 
add_filter( 'auto_update_plugin', '__return_true' );
add_filter( 'auto_update_theme', '__return_true' );

How to completely disable the WordPress auto updates

If you want to disable the WordPress auto updates completely, open the wp-config.php file and add this line to it:

define( 'AUTOMATIC_UPDATER_DISABLED', true );
 
ImportantIf you disable WordPress auto updates completely, that will disable both plugins, themes and core auto updates no mater what configurations you've made for themes or plugins.