Title: PHP code to enable CMP
Last modified: April 17, 2020

---

# PHP code to enable CMP

 *  Resolved [leighjones123](https://wordpress.org/support/users/leighjones123/)
 * (@leighjones123)
 * [6 years ago](https://wordpress.org/support/topic/php-code-to-enable-cmp/)
 * Hi guys,
 * Is there any code that I could use to enable CMP automatically?
 * I’m basically trying to get it to enable automatically when all products have
   been sold out in my WooCommerce store. I think I can work the WooCommerce bit
   out… but struggling to find the right code for CMP
 * Can this be done?
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Ales](https://wordpress.org/support/users/alesmal/)
 * (@alesmal)
 * [6 years ago](https://wordpress.org/support/topic/php-code-to-enable-cmp/#post-12688856)
 * Hello, you can simply update_option to enable CMP mode like this:
 * `update_option('niteoCS_status', '1');`
 * Ales

Viewing 1 replies (of 1 total)

The topic ‘PHP code to enable CMP’ is closed to new replies.

 * ![](https://ps.w.org/cmp-coming-soon-maintenance/assets/icon-256x256.png?rev=
   2393184)
 * [CMP - Coming Soon & Maintenance Plugin by NiteoThemes](https://wordpress.org/plugins/cmp-coming-soon-maintenance/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cmp-coming-soon-maintenance/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/)
 * [Active Topics](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cmp-coming-soon-maintenance/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Ales](https://wordpress.org/support/users/alesmal/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/php-code-to-enable-cmp/#post-12688856)
 * Status: resolved