Title: Clear cache via wp cli
Last modified: February 9, 2018

---

# Clear cache via wp cli

 *  Resolved [pavelprischepa](https://wordpress.org/support/users/pavelprischepa/)
 * (@pavelprischepa)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/)
 * Hi,
 * Is there a way to clear Varnish cache through the wp cli?
 * By the way, I tried `wp vcaching purge`, but it failed with error:
 *     ```
       Fatal error: Uncaught Error: Call to undefined method VCaching::purgeUrl() in /var/www/html/wp-content/plugins/vcaching/wp-cli.php:28
       Stack trace:
       #0 [internal function]: WP_CLI_VCaching_Purge_Command->purge(Array, Array)
       #1 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(87): call_user_func(Array, Array, Array)
       #2 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array, Array)
       #3 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(421): call_user_func(Object(Closure), Array, Array)
       #4 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(336): WP_CLI\Dispatcher\Subcommand->invoke(Array, Array, Array)
       #5 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(343): WP_CLI\Runner->run_command(Array, Array)
       #6 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1034): WP_CLI\Runner->_run_command_and_exit()
       #7 /home/www-data/.composer/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/Launch in /var/www/html/wp-content/plugins/vcaching/wp-cli.php on line 28
       ```
   
    -  This topic was modified 8 years, 3 months ago by [pavelprischepa](https://wordpress.org/support/users/pavelprischepa/).

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Razvan Stanga](https://wordpress.org/support/users/razvanstanga/)
 * (@razvanstanga)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-9955549)
 * I just run the command from WP root folder and is all ok.
 *     ```
       dev wp # wp vcaching purge --allow-root
       dev wp #
       ```
   
 * Provide more details like php version, wp version.
    -  This reply was modified 8 years, 3 months ago by [Razvan Stanga](https://wordpress.org/support/users/razvanstanga/).
 *  Thread Starter [pavelprischepa](https://wordpress.org/support/users/pavelprischepa/)
 * (@pavelprischepa)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-9955585)
 * I’ve the same error with `wp vcaching purge --allow-root`.
 * WordPress 4.9.4
    PHP 7.1.12
 * Web access (temp instance)
    [http://dev.wp1.pavel.wod.by/](http://dev.wp1.pavel.wod.by/)
   admin/admin
 *  Plugin Author [Razvan Stanga](https://wordpress.org/support/users/razvanstanga/)
 * (@razvanstanga)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-9965111)
 * I will install a fresh copy of WP on PHP 7 in a few days.
 *  Plugin Author [Razvan Stanga](https://wordpress.org/support/users/razvanstanga/)
 * (@razvanstanga)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-9972718)
 * In the meantime try this
 *     ```
       cd /var/www/html && wp vcaching purge
       ```
   
 *  Plugin Author [Razvan Stanga](https://wordpress.org/support/users/razvanstanga/)
 * (@razvanstanga)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-10185893)
 * Try version 1.6.8.
 *  Thread Starter [pavelprischepa](https://wordpress.org/support/users/pavelprischepa/)
 * (@pavelprischepa)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-10192540)
 * Yes, it works for me with 1.6.8. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Clear cache via wp cli’ is closed to new replies.

 * ![](https://ps.w.org/vcaching/assets/icon-256x256.png?rev=1293998)
 * [Varnish/Nginx Proxy Caching](https://wordpress.org/plugins/vcaching/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/vcaching/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/vcaching/)
 * [Active Topics](https://wordpress.org/support/plugin/vcaching/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/vcaching/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/vcaching/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [pavelprischepa](https://wordpress.org/support/users/pavelprischepa/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/clear-cache-via-wp-cli/#post-10192540)
 * Status: resolved