Title: wp-cli support
Last modified: May 8, 2019

---

# wp-cli support

 *  Resolved [Reiner030](https://wordpress.org/support/users/reiner030/)
 * (@reiner030)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-support-16/)
 * Hi,
 * It would be also nice to use the script by wp-cli:
 * [https://developer.wordpress.org/cli/commands/cron/event/run/](https://developer.wordpress.org/cli/commands/cron/event/run/)
 * Here one example which runs all crontab entries at once and your plugin is giving
   HTML output of the overview page part instead running the optimization:
 *     ```
        # sudo -u www-data -i -- wp cron event run --path=/data/application/lpb/staging/current --all
       Executed the cron event 'wp_privacy_delete_old_export_files' in 0.027s.
       Executed the cron event 'wpurp_cron_migrations' in 0.01s.
       Executed the cron event 'wp_update_plugins' in 2.604s.
       Executed the cron event 'wp_update_themes' in 0.013s.
       Executed the cron event 'wp_stream_auto_purge' in 0.009s.
       Executed the cron event 'wp_version_check' in 0.022s.
       Executed the cron event 'update_wpml_config_index' in 0.038s.
       Executed the cron event 'wp_scheduled_delete' in 0.013s.
       Executed the cron event 'wp_scheduled_auto_draft_delete' in 0.065s.
       Executed the cron event 'delete_expired_transients' in 0.015s.
   
                       <div id="odb-start-buttons" class="odb-padding-left">
                         <p>
                         <input class="button odb-normal" type="button" name="change_options" value="Einstellungen ändern" onclick="self.location='options-general.php?page=odb_settings_page'">
   
       <script>
       function odb_confirm_delete() {
               if(confirm('Clear the log?')) {
                       self.location = 'tools.php?page=rvg-optimize-database&action=clear_log'
                       return;
               }
       } // odb_confirm_delete()
       </script>
   
                         &nbsp;
                         <input class="button odb-normal" type="button" name="view_log" value="View Log" onclick="self.location='tools.php?page=rvg-optimize-database&action=view_log'">
                         &nbsp;
                         <input class="button odb-normal" type="button" name="clear_log" value="Clear Log" onclick="return odb_confirm_delete();">
                         &nbsp;
   
                 &nbsp;
                         <input class="button-primary button-large" type="button" name="analyze" value="Analyze Database" onclick="self.location='tools.php?page=rvg-optimize-database&action=analyze'" class="odb-bold">
                         &nbsp;
                         <input class="button-primary button-large" type="button" name="start_optimization" value="Optimierung starten" onclick="self.location='tools.php?page=rvg-optimize-database&action=run'" class="odb-bold">
   
                         </p>
                       </div><!-- /odb-start-buttons -->
                               <script>jQuery('#odb-running').hide();</script>Executed the cron event 'odb_scheduler' in 0.047s.
       Executed the cron event 'otgs_send_components_data' in 0.007s.
       Success: Executed a total of 12 cron events.
       ```
   
 * Idea was to use it in my dump-import script for staging purposes and activate
   first the new options also by wp-cli ;):
 *     ```
       sudo -u www-data -i -- wp --path=/data/application/lpb/staging/current option get odb_rvg_options --format=json \
       |   sed	-e 's/"\(clear_trash\|clear_oembed\|clear_orphans\)":"N"/"\1":"Y"/g' | \
       sudo -u www-data -i -- wp --path=/data/application/lpb/staging/current option update odb_rvg_options --format=json
       ```
   
 * which works fine so far for update the config but the run above does no deletions/
   cleanup yet.

The topic ‘wp-cli support’ is closed to new replies.

 * ![](https://ps.w.org/rvg-optimize-database/assets/icon-256x256.png?rev=3350597)
 * [Optimize Database after Deleting Revisions](https://wordpress.org/plugins/rvg-optimize-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rvg-optimize-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rvg-optimize-database/)
 * [Active Topics](https://wordpress.org/support/plugin/rvg-optimize-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rvg-optimize-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rvg-optimize-database/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Reiner030](https://wordpress.org/support/users/reiner030/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/wp-cli-support-16/)
 * Status: resolved