FAQs

How do I use the command line feature?

We’ve added WP-CLI support to our WP-Optimize Premium plugin.

WP-CLI is the command-line interface for WordPress that allows you to do all kinds of things, such as updating plugins and configuring multisite installs, without using a web browser.

Including it in WP-Optimize Premium means that you will now be able to run optimization commands directly on command-line. During this operation, WP-Oprtimize will perform in exactly the same way, but it will produce a detailed output on screen to show you what’s happening.

This feature is mainly for the experienced user, but it’s easy enough for anyone to set up and run.

  1. Before running an optimization, you will need to gather a list of optimizations available to you on command-line. To do this, you will need to run the following:
wp optimize optimizations

This will bring out the list of optimizations, as below:

Command Function
optimizetables Optimise database tables
revisions Clean all post revisions
trash Clean all trashed posts
spam Remove spam and binned comments
unapproved Remove unapproved comments
attachments Remove orphaned attachments
transient Remove expired transient options
pingbacks Remove pingbacks
trackbacks Remove trackbacks
postmeta Clean post meta data
commentmeta Clean comment meta data
orphandata Clean orphaned relationship data
Command Function
version To return the current WP-Optimize version
optimization Displays a full list of commands (as see up above) to optimize
do-optimization --optimization-id= Running the selected optimization
--path= Add this just after wp to specify the wordpress install e.g. wp –path=/var/www/html/work/multisite optimize do-optimization –optimization-id=orphandata

Our plugins

Try TeamUpdraft’s full suite of WordPress plugins.

  • UpdraftPlus

    Back up, restore and migrate your WordPress website with UpdraftPlus

  • WP-Optimize

    Speed up and optimize your WordPress website. Cache your site, clean the database and compress images

  • UpdraftCentral

    Centrally manage all your WordPress websites’ plugins, updates, backups, users, pages and posts from one location