• Hello,

    Should I do something after Updating a Plugin via FTP? I read somewhere that I should deactivate and activate the plugin to update database tables. Is this step mandatory?

    If so, can I skip this step by any of this methods? :

    · Adding a custom code in functions.php

    · Running a command via WP-CLI | WP-CLI

    Please, let me know.

    Thanks

    • This topic was modified 2 months, 2 weeks ago by jaspash.
    • This topic was modified 2 months, 2 weeks ago by jaspash.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @jaspash ,
    Yes, in many cases, after updating a plugin via FTP, it is recommended to deactivate and reactivate the plugin to ensure that any necessary database updates (like schema changes or new options) are applied. This is because some plugins require a reset or initialization when they are updated, and this often triggers functions or database updates that would not automatically occur during an FTP upload.

    Using Custom Code in functions.php: You can programmatically activate or deactivate the plugin via the functions.php file of your theme, which will trigger any necessary database updates. The code would look something like this:

    // Deactivate the plugin
    deactivate_plugins('plugin-directory/plugin-file.php');

    // Activate the plugin again to trigger database updates
    activate_plugins('plugin-directory/plugin-file.php');

    Thread Starter jaspash

    (@jaspash)

    Hello again,

    Let’s say I don’t do the “deactivate and reactivate” steps, will the native wordpress “Cron task” do the required database updates if necessary?

    Please, let me know.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.