Aller au contenu

Autres commandes

wp super-cache

Cette commande nécessite l'installation du package wp-cli/wp-super-cache-cli

$ wp package install wp-cli/wp-super-cache-cli

Aide:

$ wp super-cache --help
NAME

  wp super-cache

DESCRIPTION

  Manages the WP Super Cache plugin

SYNOPSIS

  wp super-cache <command>

SUBCOMMANDS

  disable      Disable the WP Super Cache.
  enable       Enable the WP Super Cache.
  flush        Clear something from the cache.
  preload      Primes the cache by creating static pages before users visit them
  status       Get the status of the cache.

Lancer le cron immédiatement:

$ wp cron event run --due-now

Liste des crons:

$ wp cron event list
+------------------------------------+---------------------+-----------------------+---------------+
| hook                               | next_run_gmt        | next_run_relative     | recurrence    |
+------------------------------------+---------------------+-----------------------+---------------+
| wp_cache_gc                        | 2018-08-13 19:00:37 | 2 minutes 43 seconds  | Non-repeating |
| wp_privacy_delete_old_export_files | 2018-08-13 19:50:32 | 52 minutes 38 seconds | 1 heure       |
| wp_update_plugins                  | 2018-08-13 20:19:43 | 1 heure 21 minutes    | 12 heures     |
| wp_update_themes                   | 2018-08-13 20:19:43 | 1 heure 21 minutes    | 12 heures     |
| wp_version_check                   | 2018-08-13 20:19:43 | 1 heure 21 minutes    | 12 heures     |
| delete_expired_transients          | 2018-08-14 06:15:04 | 11 heures 17 minutes  | 1 jour        |
| wp_scheduled_delete                | 2018-08-14 08:20:11 | 13 heures 22 minutes  | 1 jour        |
| wp_scheduled_auto_draft_delete     | 2018-08-14 08:27:44 | 13 heures 29 minutes  | 1 jour        |
| wpseo-reindex-links                | 2018-08-14 12:18:00 | 17 heures 20 minutes  | 1 jour        |
| wp_cache_full_preload_hook         | 2018-08-17 11:53:06 | 3 jours 16 heures     | Non-repeating |
+------------------------------------+---------------------+-----------------------+---------------+

Changer l'URL de WordPress:

$ wp option update home 'http://example.com'
$ wp option update siteurl 'http://example.com'

Supprimer les transients expirés:

$ wp transient delete --expired

Vider le cache:

$ wp cache flush

Ajouter les 2 dernières à la crontab:

crontab -e
@daily sudo -u www-data wp transient delete --expired
@daily sudo -u www-data wp cache flush

Dernière mise à jour: September 16, 2018