When it comes to website management and development, WP Engine stands out as a reliable hosting platform. It empowers users with the ability to create multiple environments for their websites, including development, staging, and production environments.
In this blog post, we’ll delve into the intricacies of deleting environments on WP Engine.
Understanding WP Engine Delete Environment
Before we dive into the details of deleting environments on WP Engine, let’s define what this process entails.
Essentially, the term “WP Engine delete environment” refers to the action of removing one of the environments associated with your website.
These environments include Production (PRD), Development (DEV), and Staging (STG). Now, let’s explore the key aspects of this process:
1. Deleting a Site Clears All Environments
It’s important to note that when you decide to delete a site on WP Engine, every environment within that site, whether it’s the production, development, or staging environment, will be deleted as well.
This ensures a clean slate but also underscores the need for caution.
2. Backup Points Before Deletion
Before proceeding with the deletion of an environment, it’s advisable to download a backup point.
This is crucial for security purposes and ensures that you have a safety net in case you need to restore anything. Only Owner level users have the authority to delete environments.
3. Unique Environment Names
WP Engine enforces a policy where environment names cannot be reused, even if the original environment has been deleted.
This prevents any confusion and ensures that each environment retains its unique identity.
4. Two Deletion Methods
WP Engine provides users with two methods for deleting an environment: Quick Action Delete and Overview Delete.
These options offer flexibility in managing the deletion process according to your preferences and requirements.
5. Managing Domain Names
When it comes to domain names, there are a few rules to follow.
Firstly, a domain cannot be added to two environments simultaneously.
Therefore, you must remove your domain from your original site before adding it to another environment.
Additionally, a domain cannot be deleted if it is set as the primary domain. To delete a domain, you must first designate an alternate domain as the primary one.
6. Password Protection for Transferable Environments
Transferable environments on WP Engine are automatically password-protected to block traffic. While this password cannot be removed until the transfer or unlock is complete, it can be changed. This security measure ensures the integrity of your data during transfers.
In summary, deleting an environment on WP Engine involves a strategic process that includes safeguarding your data, managing domain names, and choosing the appropriate deletion method.
WP Engine Environment Variables
Now that we’ve covered the process of deleting environments, let’s shift our focus to another crucial aspect of WP Engine—environment variables. These variables allow users to store sensitive information and configuration settings for their WordPress sites. Here’s what you need to know:
1. Defining Environment Variables
Users can define environment variables for their WordPress sites in the WP Engine User Portal under the Atlas environment variables section. This is the central hub where you can manage and configure these essential values.
2. Varied Names for Environment Variables Files
For example, Faust.js, Next.js, and SvelteKit apps typically use “.env.local,” while Gatsby apps typically use “.env.development”\. This ensures compatibility and easy integration with your chosen framework.
3. Alternative Configuration in wp-config.php
In addition to the WP Engine User Portal, environment variables can also be defined in the wp-config.php file using the “define()” function. This provides users with flexibility in managing their configuration settings.
4. Environment-Specific Variables
One of the advantages of WP Engine’s approach to environment variables is that they can be different for each environment. This flexibility allows for efficient management of configuration settings specific to the production, staging, and development environments.
5. Environment Identification via API
WP Engine offers an API that can be utilized to determine the environment name or type (Prod, Dev, Stage). This API integration enhances the overall management and control of your website’s environment variables.
WP Engine Staging vs. Development
WP Engine offers three environments for each site: Production (PRD), Staging (STG), and Development (DEV).
These environments serve different purposes, and it’s important to understand the distinctions between Staging and Development environments.
- A staging site serves as a secure platform for website enhancements, significantly reducing the risk associated with real-time changes.
- It’s essentially a clone of your production site, providing a safe space to experiment without affecting your live site.
- The staging environment resides on the same server as your live site, ensuring swift transitions between experiments.
- This environment is primarily used for testing and cannot be taken live.
- WP Engine includes a staging feature with all its plans.
- The development environment is also intended for testing and cannot be taken live.
- It can encompass various environments, including Staging, Development, or your local development setup.
- The development environment serves as the foundation of your development workflow.
- WP Engine recommends the use of version control in the development environment.
- Environment variables can be defined within the development environment using the WP Engine User Portal or the wp-config.php file.
Both Staging and Development environments are crucial for testing changes to your website, but they serve different purposes.
Staging is ideal for small-scale experimentation, such as minor code changes or testing plugin updates.
In contrast, the Development environment is suitable for larger changes, like a complete rebrand or the creation of an entirely new site. WP Engine provides these environments to cater to various testing needs.
Choosing the Right Environment
Now that we’ve explored the differences between Staging and Development environments, it’s essential to understand when to use each of them:
- Staging Environment: Utilize the staging environment when you want to test small changes to your website before implementing them on your live site. This environment is perfect for minor code adjustments or plugin updates, as it replicates your production site without the risk of affecting it.
- Development Environment: Opt for the development environment when you’re planning to test more substantial changes, such as a full rebrand or the creation of a brand-new site. This environment is versatile and can encompass Staging, Development, or your local development setup, making it suitable for a wide range of testing scenarios.
WP Engine’s provision of three distinct environments—Production (PRD), Staging (STG), and Development (DEV)—ens
ures that you have the right tools at your disposal for efficient testing and development.
How to Create a Staging Site for WordPress
Creating a staging site for your WordPress website on WP Engine is a straightforward process. Let’s go through the steps:
- Log In: Begin by logging in to your WP Engine dashboard. This is your central hub for managing your website.
- Access Your Site: Navigate to the ‘Sites’ page, where you’ll find a list of your websites. Select the website for which you want to create a staging environment by clicking on it.
- Add Staging: Look for the ‘Add Staging’ option on the left-hand column or under your site name at the top. Click on it to initiate the staging site creation process.
- Name Your Staging Site: Provide a name for your staging site. This name should reflect the purpose of your staging environment, making it easy to identify later on.
- Create Environment: Once you’ve named your staging site, click the “Create Environment” button. WP Engine will then proceed to create your staging environment.
Alternatively, if you prefer to create a staging site manually, consider these options:
- WordPress Hosting Service: Utilize your WordPress hosting service to establish a staging environment. Most hosting providers, including WP Engine, offer this functionality.
- WordPress Staging Plugin: Explore WordPress staging plugins as an alternative solution. These plugins streamline the process and provide you with more control over your staging environment.
- Local Development Environment: For advanced users, creating a standalone local installation of your website platform can provide an isolated space for experimentation. This approach allows you to make changes without affecting your main website.
Regardless of the method you choose, always remember to save a recent backup of your website before making any changes. This precaution ensures that you can revert to a previous state if needed.
Once you’ve made the desired changes to your staging site and are ready to deploy them to your live site, WP Engine’s staging feature simplifies the process, requiring just a click of a button.
In this comprehensive guide, we’ve explored the intricate aspects of WP Engine’s environment management, deletion, and the creation of staging sites.
Whether you’re looking to delete an environment, manage environment variables, understand the differences between staging and development environments, or create a staging site for your WordPress website, WP Engine provides the tools and flexibility you need for efficient website management and development.
By following the guidelines outlined in this blog post, you can navigate these processes with confidence and precision, ensuring a smooth experience with WP Engine.