Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
Coppa WPB
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Come attivare gli aggiornamenti automatici per i plugin e i temi di WordPress

Nota editoriale: guadagniamo una commissione dai link dei partner su WPBeginner. Le commissioni non influenzano le opinioni o le valutazioni dei nostri redattori. Per saperne di più su Processo editoriale.

Recentemente uno dei nostri lettori ci ha chiesto come aggiornare automaticamente i plugin di WordPress.

Molti utenti trovano fastidioso dover aggiornare un plugin quasi ogni due giorni.

In questo articolo vi mostreremo come attivare gli aggiornamenti automatici per i plugin di WordPress. Vi mostreremo anche come escludere alcuni plugin dagli aggiornamenti automatici.

How to Enable Automatic Updates for WordPress Plugins

Quando e perché aggiornare automaticamente i plugin di WordPress?

Per impostazione predefinita, WordPress può aggiornarsi automaticamente quando è disponibile una versione di sicurezza o minore. Per le versioni maggiori, è necessario avviare l’aggiornamento da soli. È inoltre necessario installare autonomamente gli aggiornamenti dei plugin e dei temi.

Mantenere aggiornato il vostro sito WordPress è fondamentale per la sicurezza e la stabilità del vostro sito. Consultate la nostra guida sul perché dovreste sempre utilizzare l’ultima versione di WordPress.

Lo stesso vale per tutti i plugin e i temi installati sul vostro sito web. È necessario installare gli aggiornamenti di temi e plugin per ottenere nuove funzionalità e correzioni.

Tuttavia, avrete notato che alcuni di essi vengono aggiornati più frequentemente di altri. Molti plugin popolari vengono aggiornati quasi settimanalmente.

WordPress updates

Alcuni utenti trovano un po’ fastidioso che ogni volta che effettuano il login sia disponibile un aggiornamento per uno o più plugin.

E se si potesse permettere a sviluppatori fidati di aggiornare automaticamente i plugin, in modo simile a WordPress.

Vediamo come aggiornare automaticamente i plugin in WordPress.

Come installare automaticamente gli aggiornamenti per alcuni plugin in WordPress

WordPress ha introdotto gli aggiornamenti automatici per i plugin e i temi di WordPress in WordPress 5.5. Ciò consente di attivare gli aggiornamenti automatici per i singoli plugin e temi di WordPress direttamente dalla dashboard di WordPress.

Abilitazione degli aggiornamenti automatici per singoli plugin

È sufficiente visitare la pagina Plugin ” Plugin installati nell’area di amministrazione di WordPress. Qui vedrete l’elenco di tutti i vostri plugin installati con un link per “Abilita aggiornamenti automatici” accanto a ciascun plugin.

Enable automatic updates for WordPress plugins

È necessario fare clic sul link “Abilita aggiornamenti automatici” per attivare gli aggiornamenti automatici per i singoli plugin.

Abilitazione degli aggiornamenti automatici per i temi di WordPress

Per i temi di WordPress, è necessario visitare Aspetto ” Temi e fare clic sul tema che si desidera aggiornare automaticamente.

Verrà visualizzata la finestra a comparsa delle informazioni sul tema. Da qui è possibile fare clic sul link “Abilita aggiornamenti automatici” per attivare gli aggiornamenti automatici per quel tema.

Theme auto-updates

Questo è tutto. Ora WordPress aggiornerà automaticamente questi plugin e temi ogni volta che sarà disponibile una nuova versione. Riceverete anche una notifica via e-mail ogni volta che un nuovo aggiornamento viene installato sul vostro sito web.

Impostazione dell’aggiornamento automatico per tutti i plugin di WordPress

È possibile impostare WordPress in modo che installi automaticamente tutti gli aggiornamenti dei plugin semplicemente aggiungendo questo codice al file functions.php del tema, a un plugin specifico per il sito o a un plugin Code Snippets.

add_filter( 'auto_update_plugin', '__return_true' );

Questo filtro indica al programma di aggiornamento automatico di WordPress di installare automaticamente gli aggiornamenti dei plugin quando sono disponibili.

Se si desidera aggiornare automaticamente i temi, si può aggiungere un altro codice come questo:

add_filter( 'auto_update_theme', '__return_true' );

Si consiglia di aggiungere questo codice utilizzando il plugin WPCode. È il modo più sicuro e semplice per aggiungere snippet di codice personalizzati in WordPress senza modificare il file functions.php del tema.

Per iniziare, è necessario installare e attivare il plugin gratuito WPCode. Se avete bisogno di istruzioni, consultate questa guida su come installare un plugin di WordPress.

Una volta attivato il plugin, andate su Code Snippets Add Snippet dalla vostra dashboard di WordPress. Da qui, trovate l’opzione “Add Your Custom Code (New Snippet)” e fate clic sul pulsante “Use snippet” sotto di essa.

Add a new custom code snippet in WPCode

Quindi, aggiungete un titolo per il vostro snippet di codice. Può essere qualsiasi cosa che aiuti a ricordare a cosa serve il codice.

Quindi, è sufficiente incollare il codice di cui sopra nella casella “Anteprima codice” e selezionare “PHP Snippet” come tipo di codice dal menu a discesa.

Paste code snippet into WPCode

Infine, spostare l’interruttore da ‘Inattivo’ ad ‘Attivo’ e fare clic sul pulsante ‘Salva snippet’.

Activate and save your custom code snippet

Ecco fatto. Se si desidera aggiungere il secondo codice elencato sopra, è sufficiente ripetere questi passaggi.

Come tornare a una versione precedente del plugin dopo l’aggiornamento?

Le incompatibilità dei plugin o dei temi possono causare problemi al vostro sito web. Anche se la maggior parte dei bravi sviluppatori testa accuratamente i propri plugin, ci sono sempre rari bug che possono causare la rottura del vostro sito.

Il primo passo da compiere per proteggere il vostro sito web è installare una soluzione di backup per WordPress.

Tuttavia, il ripristino del sito WordPress da un backup sembra un lavoro molto impegnativo. Se si conosce l’aggiornamento del plugin o del tema che ha causato il problema, sarebbe più facile ripristinare l’aggiornamento.

Ecco come è possibile eseguire facilmente il rollback degli aggiornamenti dei plugin o dei temi. Basta installare e attivare il plugin WP Rollback.

Dopo l’attivazione, tornate alla pagina dei plugin sul vostro sito WordPress. Noterete una nuova opzione di rollback sotto ogni plugin installato sul vostro sito.

Rollback plugin's to previous versions

Facendo clic su Rollback è possibile eseguire il rollback del plugin a qualsiasi versione precedente. Può anche eseguire il rollback degli aggiornamenti dei temi. Per istruzioni più dettagliate, consultate la nostra guida su come eseguire il rollback dei plugin di WordPress.

Speriamo che questo articolo vi abbia aiutato a impostare gli aggiornamenti automatici per i plugin in WordPress. Potreste anche consultare la nostra guida su come attivare gli aggiornamenti automatici in WordPress per le versioni principali o la nostra selezione dei migliori page builder drag and drop per WordPress.

Se questo articolo vi è piaciuto, iscrivetevi al nostro canale YouTube per le esercitazioni video su WordPress. Potete trovarci anche su Twitter e Facebook.

Divulgazione: I nostri contenuti sono sostenuti dai lettori. Ciò significa che se cliccate su alcuni dei nostri link, potremmo guadagnare una commissione. Vedi come WPBeginner è finanziato , perché è importante e come puoi sostenerci. Ecco il nostro processo editoriale .

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Il kit di strumenti WordPress definitivo

Ottenete l'accesso gratuito al nostro kit di strumenti - una raccolta di prodotti e risorse relative a WordPress che ogni professionista dovrebbe avere!

Reader Interactions

39 commentiLascia una risposta

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Mrteesurez says

    When it’s good to have both plugins and theme with the WordPress core to update automatically, it certainly comes with some cons.
    1) If there is a crash, it will be difficult to easily identify the culprit plugin, theme or specific action that triggered the issue.
    2) For me, I used to firstly check the changealog to know the new features coming with the new update, so I can know what functions has added or removed form the plugin.

    I still choose to do it manually.

  3. Moinuddin Waheed says

    I prefer doing manual updates to my wordpress websites as it gives a sense of control over the update and also it feels secure not to take risk of crashing the website completely.
    I have heard many times that having updated version is of utmost importance to keep the WordPress safe, is it really the security patch that gets updated always or other factors as well?
    Also, is it advisable to always have the latest version or to have update only when there is security update is concerned?

    • WPBeginner Support says

      More than just security is patched when updating a plugin and we recommend keeping plugins and themes up to date as some add helpful new features for your site :)

      Admin

  4. Jiří Vaněk says

    And what is your specific opinion on automatic updates? Personally, I’ve always found it much better to manage updates manually because it’s possible, and it has often happened to me, that after an update, the website crashed and it took hours or even days before anyone noticed. For that reason, for example, I’ve refrained from automatic updates.

    • WPBeginner Support says

      It depends on the specific site, for more complex sites it is normally better to manually update the site but for simple sites automatic updates are normally for the best.

      Admin

  5. Madhav Anand says

    Nothing worked out please help.

    1. The plugin which is mentioned no longer available to download and use.
    2. On adding code to functions.php it shows “Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.”

    Please update

  6. Sushil Kumar says

    You can replace the link for “Automatic Plugin Updates” plugin because it is obsolete now and This plugin was closed on October 2, 2018 and is no longer available for download.

  7. VBWyrde says

    Thanks for this information. I installed the plugins mentioned on my test wordpress site (I want to check out how well it works before applying it to my production site). After Activating the plugin and checking off the one’s I want included in the auto-update… wondering… is there any indicator that the plugins are actually being updated? Or do we just wait and check the site later? Thanks again for your advice on this. Much obliged.

  8. Ahad Arzi says

    Hi, first of all thanks for the post. But, Adding that above mentioned auto update plugin code and theme code is recommended? Or It can create any problems in future?

    Please let me know!

  9. Anja says

    As a follow up, I’ve since installed the recommended plugin and that didn’t work either. Troubleshooting points to the site being a managed GoDaddy account as the culprit, so if anyone else has the same problem that may be the cause.

  10. Anja says

    Hi,

    As a beginner I was wondering where exactly I should put this code? Both examples use line 1, but I’m using a child theme and it needs to enque styles first.

    I’ve put it at the bottom following the CSS rule, but I’m not sure if that would create problems or not? I would really appreciate a response.

    Thanks :)

      • Anja says

        Hi,

        This doesn’t seem to have worked as I’m getting a plug-in that needs to be updated. Being a beginner and not knowing PHP I maybe haven’t nested it properly (I haven’t added any nesting at all)?

        My script reads:

        }
        add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );

        add_filter( ‘auto_update_plugin’, ‘__return_true’ );

        add_filter( ‘auto_update_theme’, ‘__return_true’ );

        And it literally ends there. I read on the wordpress codex that lines like this should be added to the wp-config file (which I haven’t done because I have no idea to do it). For educational purposes, why have you chosen functions.php instead?

        Thanks again for your help, and I’m sorry if this is an obvious question.

        • Anja says

          Please? I really don’t know what I’ve done wrong, even though further reading did reveal why you’ve added this to functions.php and NOT the codex (as they write not to put it in for these especially).

        • Anja says

          Pretty please? As a beginner I really can’t think of what else to do, and this article is targeted at beginners. You need to consider that for every one person who takes the time to say something or ask a question there’s probably about 10 others who’ve just passed on.

  11. Devin says

    If you edit the functions.php file ….. won’t it just get overwritten by any new wordpress framework updates?

  12. Steve says

    The WP Rollback plugin has not been updated in 8 months as of 5/16/2017. Do you still recommend it or attest to it’s viability for release 4.7.4 of WordPress or earlier?
    Thx
    Steve

  13. Panagiotis says

    WordPress Codex advises to put this code to wp-config.php what are the pros and cons of putting it to functions.php ?

    • Peter says

      No, it says:
      “Do NOT add add_filter() calls directly in wp-config.php. WordPress isn’t fully loaded and can cause conflicts with other applications such as WP-CLI.”

      • Panagiotis says

        Ah filters filters filters.
        Got confused because in the codex it gives some definitions as well that should be put in wp-config.php, filters should go on functions.php. Thanks Peter.

  14. Gail Palubiak says

    You left out one small item…HOW does a beginner(!) insert this code? A few additional screen shots would have been helpful. Thanks

    • Panagiotis says

      Hello Gail,
      you can insert this code by logging in with your ftp credentials to your site and edit functions.php that is located in the /public_html/ folder.

      • Oosman Beekawoo says

        There are so many functions.php files in the /public_html/ folder. Which one do I choose?

        There’s one of them in wp-includes, some in a few of my plugin folders and one in each of my theme folders.

  15. Carol Parker says

    Just handing out compliments – this is absolutely the most useful newsletter I have ever encountered. Your one-topic specific ‘how to’ posts are so well done – easy to understand and solve issues I didn’t know I had! Thank you, thank you, thank you. My blogs are getting more sophisticated by the day as I learn how to accomplish the fine details.

  16. Jason says

    Great article! Thanks for publishing it!!

    Just curious, the code snippets for both plugins and themes state the same thing. Is there supposed to be a difference?

    Thanks again!

  17. Shelley Provenza says

    Should the 2nd snippet for themes be this?:

    add_filter( ‘auto_update_theme’, ‘__return_true’ );

Lascia una risposta

Grazie per aver scelto di lasciare un commento. Tenga presente che tutti i commenti sono moderati in base alle nostre politica dei commenti e il suo indirizzo e-mail NON sarà pubblicato. Si prega di NON utilizzare parole chiave nel campo del nome. Avremo una conversazione personale e significativa.