It's always a good idea to migrate a new WordPress framework or theme to a staging site first. This allows you to get things working and looking how you want without impacting the live site until you are ready.
There are a few key things you want to know about working with Trellis on a staging site. We'll cover all of those details in this article!
Using Your Trellis License on Staging
Trellis licenses are designed to work on just one site (unless you purchase a multi-site license). This means that you may run into issues if you try to add your license to both a staging site and your live site. You would likely receive the below error message:
When you're ready to push the site live from staging, remove the license from the staging site BEFORE you push Trellis live. Then you can add it back on the live site.
If you experience any issues in this process, or if you wish to test changes on your staging site AFTER you've already launched Trellis on your live site, our team can help at firstname.lastname@example.org.
Ads on Staging Sites
Whether you are a Mediavine publisher or working with a different ad manager, it's good to keep in mind that ads don't always load correctly on staging sites. If you see an ad display issue on staging, don't be alarmed. You will really only know the true state of things once you have pushed Trellis live.
This in mind, the best thing to do is to reach out to your ad manager AFTER you have pushed Trellis live, so that any ad targeting issues can be corrected properly.
Trellis is automatically targeted for Mediavine ads, so there normally shouldn't be issues, but please reach out to email@example.com once your new framework is live so that we can check everything over.
Speed Testing on Staging
Speed testing in Google PageSpeed Insights, or with other tools, is generally not recommended on staging sites. Accurate results cannot be expected, most of the time, because performance optimizations do not always work properly on staging. This applies to Trellis's built-in optimizations as well.
For example, one of the main optimizations that makes Trellis so fast is Critical CSS. Critical CSS may not generate correctly on a staging site, and once Trellis is pushed live, it will take about 24 hours for Critical CSS to generate fully.
This means the recommended time to start speed testing would be after Trellis is live and at least 24 hours after it has been pushed live. Test a post (not the homepage) to give you a better idea of what your readers are experiencing. This is the best method for getting more accurate speed testing results.
REST API Notice on Staging Sites
You may see a message on your staging site saying:
Critical CSS has been disabled
Trellis is having trouble with your REST API. Trellis will continue attempting to reach your REST API and Critical CSS will be enabled if Trellis can connect to your REST API.
Please note that on staging sites, it is normal to see this message, so you do not need to be concerned. Trellis's Critical CSS typically does not work properly on staging, which can trigger the REST API message.
If you still see the REST API notice once your site is live, please email our team at firstname.lastname@example.org for help.
To learn more about what this message means, please reference this help article.
Up Next: What to Do After You Install Trellis