WPCode Logo

WPCode Documentation

Documentation, Reference Materials, and Tutorials for WPCode

Most Popular

Get free tips and resources right in your inbox, along with 500+ others

Follow Us

Using Testing Mode

Would you like to try a change to a code snippet on your live site without your visitors seeing it until it’s ready?

In this guide, we’ll walk you through previewing snippet changes with WPCode’s Testing Mode and publishing or discarding them.

Requirements: Testing Mode is available in the paid versions of WPCode.

Before you get started, make sure WPCode is installed and activated on your WordPress site.

Turning On Testing Mode

To get started, we’ll switch on Testing Mode so your snippet changes stay hidden from visitors while you check them.

From your WordPress admin sidebar, go to Code Snippets » Code Snippets.

The WPCode Code Snippets list opened from the Code Snippets menu in the WordPress admin sidebar

At the top right of every WPCode screen, click the Testing Mode toggle to turn it on.

The WPCode header bar with an arrow pointing at the Testing Mode toggle, switched off, next to Help

WPCode confirms that Testing Mode is on and explains who can see your changes. When you’ve read it, click OK.

The Testing Mode Enabled message explaining that changes are only visible to users who can manage WPCode snippets, with an arrow pointing at the OK button

Testing Mode now stays on until you switch it off, even if you log out.

Making and Previewing Changes

While Testing Mode is on, you edit snippets the same way as always. In our example, we’ve changed a free shipping banner from $50 to $40.

When your edit is ready, click Update at the top of the snippet editor.

The Edit Snippet screen for a snippet named Free Shipping Banner, with the code changed to over $40 and an arrow pointing at the Update button

WPCode saves your edit as a test version and leaves the live version in place. The editor now shows a Publish Changes button next to Update. We’ll come back to it when you’re ready to publish.

The Edit Snippet screen after updating in Testing Mode, with an arrow pointing at the new Publish Changes button beside Update

To check your change, open your site while you’re logged in. Admins who can manage snippets see the test version on the front end and in the admin.

The bottom of the site viewed by a logged-in admin, showing the test banner reading Free shipping on all orders over $40

Everyone else still sees the live version. Here’s the same page for a visitor who isn’t logged in.

The bottom of the site viewed by a logged-out visitor, still showing the live banner reading Free shipping on all orders over $50

The same applies to your Global Header & Footer scripts and Page Scripts. Changes you save to them in Testing Mode stay hidden from visitors too.

Publishing or Discarding Your Changes

When you’re happy with a change, you can publish it for everyone. To publish just one snippet, use the Publish Changes button in its editor. After you confirm, WPCode publishes that snippet and your other test changes stay in Testing Mode.

To finish testing, switch off the Testing Mode toggle. WPCode lists every change made in Testing Mode so you can review them before you decide. Each item links to its editor.

To make all of your changes live, click Save & Publish Changes.

The Disable testing mode? window listing Free Shipping Banner under Updated Snippets, with an arrow pointing at the Save and Publish Changes button beside Discard all changes and Cancel

WPCode then switches Testing Mode off. Your visitors now see every change you tested.

If you’d rather keep your live site as it was, click Discard all changes instead. WPCode drops every test change.

To keep testing, click Cancel. Testing Mode stays on.

That’s it! You now know how to test snippet changes privately and publish them when they’re ready. Next, take a look at our guide on PHP error handling and safe mode. It shows how WPCode protects your site while you work on code.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about WPCode’s Testing Mode.

Who sees my changes while Testing Mode is on?

Every logged-in user who can manage WPCode snippets sees the test version. That includes other admins, not just you. Logged-out visitors and other users see the live version.

How do I test a brand-new snippet in Testing Mode?

First, save the new snippet with its status set to Inactive. Then switch it on from the Code Snippets list while Testing Mode is on. Only admins who can manage snippets see it until you publish your changes.

Does Testing Mode cover conversion pixels?

No. Changes on the Conversion Pixels screen go live as soon as you save them. WPCode shows a note about this on that screen while Testing Mode is on.

Why can’t I move a snippet to the trash?

WPCode hides the Trash options in the Code Snippets list while Testing Mode is on. When you’re ready to remove a snippet, switch Testing Mode off first.

What happens to snippets I created during Testing Mode if I discard my changes?

WPCode deletes them permanently, along with any snippet you duplicated while testing. Edits to snippets you already had simply go back to their live version.

Still stuck? How can we help?

Last Updated on

Get Started Today & Add Your Own Snippets

Future-proof your website with WPCode Snippets and improve the way you manage code across all your websites.