Title: Different API keys per environment
Last modified: June 1, 2018

---

# Different API keys per environment

 *  Resolved [needle hoffenheimer](https://wordpress.org/support/users/needle-hoffenheimer/)
 * (@needle-hoffenheimer)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/different-api-keys-per-environment/)
 * How might one go about setting the Stripe API keys on a per-environment basis?
   Every time I push my database changes from dev to live, my Stripe API keys get
   overwritten. I need a way to set the keys at the environment level, something
   like this in wp-config.php:
 * define(‘STRIPE_PUBLISHABLE_KEY’, env(‘my_stripe_publishable_key_here’));
    define(‘
   STRIPE_SECRET_KEY’, env(‘my_stripe_secret_key_here’));
 * Does this make sense? Will the Stripe Gateway plugin recognize my keys if I define
   them in this way instead of in the plugin admin?

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

 *  [Thomas Shellberg](https://wordpress.org/support/users/shellbeezy/)
 * (@shellbeezy)
 * Automattic Happiness Engineer
 * [7 years, 11 months ago](https://wordpress.org/support/topic/different-api-keys-per-environment/#post-10359566)
 * Hi there,
 * This isn’t possible without a customization to the plugin – perhaps you could
   just exclude certain tables when pushing your database changes(exclude wp_options
   for instance)?
 *  Plugin Support [melinda a11n](https://wordpress.org/support/users/melindahelt/)
 * (@melindahelt)
 * Automattic Happiness Engineer
 * [7 years, 10 months ago](https://wordpress.org/support/topic/different-api-keys-per-environment/#post-10408210)
 * We haven’t heard back from you in a while, so I’m going to mark this as resolved–
   if you have any further questions, you can start a new thread.

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

The topic ‘Different API keys per environment’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-gateway-stripe/assets/icon-256x256.png?rev=3177277)
 * [WooCommerce Stripe Payment Gateway](https://wordpress.org/plugins/woocommerce-gateway-stripe/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-gateway-stripe/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-gateway-stripe/reviews/)

## Tags

 * [constants](https://wordpress.org/support/topic-tag/constants/)

 * 2 replies
 * 3 participants
 * Last reply from: [melinda a11n](https://wordpress.org/support/users/melindahelt/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/different-api-keys-per-environment/#post-10408210)
 * Status: resolved