Title: How to enable/Configure WPSC programatically &#8211; no WP-Cli?
Last modified: July 15, 2025

---

# How to enable/Configure WPSC programatically – no WP-Cli?

 *  Resolved [ulicgn](https://wordpress.org/support/users/ulicgn/)
 * (@ulicgn)
 * [10 months, 4 weeks ago](https://wordpress.org/support/topic/how-to-enable-configure-wpsc-programatically-no-wp-cli/)
 * Using WP Super Cache in an oldstyle Webhosting environment was easy:
   1) enable
   plugin2) enable caching in plugin settings and configure3) done for goodJust 
   like every other plugin in the world 😉
 * Now we deploy our WordPress Sites into a docker environment from a clean git 
   repo checkout using CI/CD tools, and we’re encountering difficulties fully enabling
   WP Super Cache after every deployment.
 * In addition to setting WP_CACHE and WPCACHEHOME (which is done upon deployment),
   we have to do multiple manual or script-driven steps.
 * After every fresh deployment, wp-cache-config.php and advanced-cache.php are 
   missing – since they are generated at runtime and contain dynamic information,
   we can not keep them in the repo. Also the configuration values are not persistent
   in wp_options, thus every fresh deployed container is coming up unconfigured 
   with no caching in spite of wpsc being enabled. Then, we have to:
 * 1) trigger creation of advanced-cache.php
   ( using wp_cache_create_advanced_cache())
   2) trigger creation of wp-cache-config.php ( using wp_cache_verify_config_file())
   3) re-configure the plugin-settings, specifically set cache_enabled and super_cache_enabled
   to 1, otherwise no caching at all takes place( using a lot of wp_cache_setting()
   calls )
 * I was hoping there would be wpcli commands to enable and configure WPSC, but 
   it seems as if these are no longer present in 3.x (right?) So we were forced 
   to create a plugin that exposes a wpcli command to perform all the listed activities
   using the global functions we found in wp-cache.php (not sure whether I picked
   the best ones ). This wpcli command is then being called after deployment.
 * This kind of works, but is very clumsy and errorprone, and I lost my trust that
   the cache will be present after every deployment.
 * Bottom Line:
   **What is the most reliable and efficient way to either programmatically
   enable WPSC in a CD/CI environment, or to keep its activation and configuration
   persistently in the DB like regular plugins do?** Are there any best practices,
   recommended hooks, or alternative methods within WPSC itself?
 * Regards,
   Ulrich

Viewing 1 replies (of 1 total)

 *  Plugin Support [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * (@erania-pinnera)
 * [10 months, 3 weeks ago](https://wordpress.org/support/topic/how-to-enable-configure-wpsc-programatically-no-wp-cli/#post-18561407)
 * Hi there, [@ulicgn](https://wordpress.org/support/users/ulicgn/),
 * Thanks so much for taking the time to think about how things could work better.
 * Regarding your suggestion, you’re right that having stock `wp-cache-config.php`
   and `advanced-cache.php` files ready to copy into new installs could be helpful
   in certain setups.
 *  However, I do want to be upfront that WP Super Cache is currently in maintenance
   mode, so we’re not actively developing new features or adding things like a WP-
   CLI interface at this time.
 * If you’d like, you’re more than welcome to submit a PR in the repository with
   any improvements or additions you have in mind. We do review community PRs when
   we can, and if everything checks out, we’re happy to release them. But just to
   set expectations, we can’t guarantee a timeline for that.
 * I have asked our developers to chime on this, so they’ll reply to you as soon
   as they can – not earlier than next week anyway.
 * Hope that helps! Thanks again for your input – it really does help us keep the
   plugin stable and useful for everyone 🙂
    -  This reply was modified 10 months, 3 weeks ago by [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/).

Viewing 1 replies (of 1 total)

The topic ‘How to enable/Configure WPSC programatically – no WP-Cli?’ is closed 
to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Stef (a11n)](https://wordpress.org/support/users/erania-pinnera/)
 * Last activity: [10 months, 3 weeks ago](https://wordpress.org/support/topic/how-to-enable-configure-wpsc-programatically-no-wp-cli/#post-18561407)
 * Status: resolved