Lead Generation Marketing Agency Lead Generation Marketing Agency
  • Marketing Calculators & Tools
    • Free Online Marketing Report
    • Lead Generation Campaign Breakeven Calculator
    • Ads Conversion Value Calculator
    • Recommended Marketing Spend Calculator
    • HighLevel: A2P 10DLC Registration Template
    • Proration Calculator
  • Websites
    • Free Privacy Policy Generator
    • Website Accessibility Tax Credit
    • Fastest WordPress Hosting
    • Gravity Forms Tips
    • Perfect Gravity Forms SPAM Blocking
    • Plugins
    • How to Think about SEO
  • Portfolio
  • Blog
    • Cloudflare Setup
    • Marketing Learned from Jesus
    • Accept Payments w/o Subscription
    • Spy on your Competitors’ Google Ads
  • Contact Us
  • Book Appointment
  • LeadGen Agency Education
    • HighLevel Tips
    • Our GHL YouTube Playlist
    • All GHL Terminology
    • Common High Level Software Questions and Why to Choose GHL
    • Value-Based Pricing Notes
    • Custom Photo Gallery on HighLevel (GHL) Websites
    • Automatically Blocking Social Media Spam DMs in HighLevel

WP Engine Staging Site’s Own wp-config.php Rules

By Clifford P on August 16, 2013

Here’s something everyone should add to their wp-config.php file if hosted with WP Engine:

Table of Contents

Toggle
  • How it Works
  • Get Creative
  • Not Yet Hosting with WP Engine? Just do it.

How it Works

WP Engine loads up everyone’s wp-config.php files for their own wrangling — for optimization, SSL settings, and even hard-coding domains.

Part of the Copy from Production to Staging process is regenerating the wp-config.php with your staging site’s domain as the DOMAIN_CURRENT_SITE value. Here’s what the differences look like:

Production wp-config.php contains this:

define(‘DOMAIN_CURRENT_SITE’, ‘www.example.com’);

Staging wp-config.php contains this:

define(‘DOMAIN_CURRENT_SITE’,’example.staging.wpengine.com’);

So the code above says “if DOMAIN_CURRENT_SITE ends in .staging.wpengine.com, do …”

That’s why the code NEEDS to be placed below WP Engine’s initial defining of DOMAIN_CURRENT_SITE.

Basically, just scroll all the way to the bottom and place this code just before the “# That’s It. Pencils down” line.

WP Engine wp-config-php Conditionals

Get Creative

Of course, you could invert the logic and have rules just for Production instead of or in addition to just for Staging.

An alternative method that may be preferred by some can be found at Paulund: Multi-Environment WordPress wp-config.php.

Now that you know how to have separate rules for WP Engine Production vs. WP Engine Staging, you might be looking for some more sweet wp-config.php hacks.

Not Yet Hosting with WP Engine? Just do it.

Click the image below to get started.

WP Engine HostingAffiliate link

Posted in Advice/Tips/How-To.
PreviousAt Least 5 Ways to Embed Gists in WordPress
NextLastPass Free or Paid + LastPass Alternatives 2022
  • For your review: our Policies and Contact Information

    Copyright © 2010–2025 · Log in

    Made with by Clifford Paulick

  • Lead Generation Marketing Agency–Always Improving Since 2010
  • Free Marketing Calculators & Tools
    • Lead Generation Campaign Breakeven Calculator
    • Free Online Marketing Report
    • Recommended Marketing Spend Calculator
    • HighLevel: A2P 10DLC Registration Template
    • Prorate Amount between Two Dates
  • Website Accessibility Tax Credit
  • HighLevel White Label Marketing Software
  • Contact Us
  • Blog
  • Marketing Calculators & Tools
    • Free Online Marketing Report
    • Lead Generation Campaign Breakeven Calculator
    • Ads Conversion Value Calculator
    • Recommended Marketing Spend Calculator
    • HighLevel: A2P 10DLC Registration Template
    • Proration Calculator
  • Websites
    • Free Privacy Policy Generator
    • Website Accessibility Tax Credit
    • Fastest WordPress Hosting
    • Gravity Forms Tips
    • Perfect Gravity Forms SPAM Blocking
    • Plugins
    • How to Think about SEO
  • Portfolio
  • Blog
    • Cloudflare Setup
    • Marketing Learned from Jesus
    • Accept Payments w/o Subscription
    • Spy on your Competitors’ Google Ads
  • Contact Us
  • Book Appointment
  • LeadGen Agency Education
    • HighLevel Tips
    • Our GHL YouTube Playlist
    • All GHL Terminology
    • Common High Level Software Questions and Why to Choose GHL
    • Value-Based Pricing Notes
    • Custom Photo Gallery on HighLevel (GHL) Websites
    • Automatically Blocking Social Media Spam DMs in HighLevel