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

Enable Permissions to Deploy From Library

Would you like to push code snippets from the WPCode Library to your sites without logging in to each one?

In this guide, we’ll show you how to let the WPCode Library deploy snippets to your site and approve each deploy with a passkey.

Requirements: You’ll need a WPCode Library account. Passkey approval needs WPCode 2.4.1 or later on your site.

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

Enabling Deploys on Your Site

To get started, we’ll turn on deploys for your site. You switch this on per site, when you connect that site to your WPCode Library account.

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

The WPCode General Settings tab opened from the Code Snippets menu in the WordPress admin sidebar, with Settings highlighted in the menu

If your site is already connected to the library, you’ll need to reconnect it with deploys enabled. Next to WPCode Library Connection, click Disconnect from the WPCode Library. If your site isn’t connected yet, skip this step.

The WPCode Library Connection setting with an arrow pointing at the Disconnect from the WPCode Library button

Now, click Connect to the WPCode Library.

The WPCode Library Connection setting with an arrow pointing at the Connect to the WPCode Library button

A new window opens. Log in to your WPCode account if you’re asked to. Then, check the Enable pushing snippets from the library to your site option.

The connect window with an arrow pointing at the checked Enable pushing snippets from the library to your site option, and a note that each push is approved with a passkey

With WPCode 2.4.1 or later, a note appears below the option. It explains that you’ll approve each deploy with a passkey. When you’re ready, click Connect to WordPress.

The connect window with deploys enabled and an arrow pointing at the Connect to WordPress button

If your account already has a passkey, the window closes and your settings page reloads. Your site is connected.

If your account doesn’t have a passkey yet, the window asks you to add one first. Next, enter your WPCode account password. Then, click Create passkey.

Step 1 of 2, Add your passkey, with the account password entered and an arrow pointing at the Create passkey button

Your browser then asks you to create the passkey with the fingerprint, face, or PIN you use to unlock your device. Once it’s created, the window closes and your site is connected. If your device can’t set up a passkey, the window tells you, and you can try again from a different device.

Done! The WPCode Library Connection setting shows the Disconnect from the WPCode Library button again. You can now deploy snippets from the library to this site.

Approving Deploys with a Passkey

A passkey makes sure every deploy is approved by you, on your device. Signing in to your WPCode account isn’t enough on its own to send code to your site.

Your passkey stays on your device, and WPCode never sees it. Your site checks each deploy against the passkeys that were on your account when you connected it. If the approval doesn’t match, the site refuses the code.

Checking Which Sites Are Protected

The WPCode Library shows how each of your sites is connected. After you sign in to the library, go to My Sites. The Security column shows Passkey for sites that need a passkey to approve deploys.

The My Sites list in the WPCode Library showing Alex's Candle Co. as Connected, with Passkey in the Security column and WPCode version 2.4.1

Sites connected with an older version of WPCode keep working as they did before. To protect one of them, update WPCode on that site to 2.4.1 or later. Then reconnect it from its WordPress admin while you’re signed in to your WPCode account.

Adding Another Passkey

If you deploy from more than one device, give each device its own passkey. In the WPCode Library, go to Deploy Security and click Add passkey.

The Deploy Security page listing one passkey, with an arrow pointing at the Add passkey button

Give the passkey a name you’ll recognize, such as the device it’s on. Next, enter your account password. Then, click Create passkey and confirm on your device when your browser asks.

The Add a passkey window with Work laptop as the passkey name and the account password entered, with an arrow pointing at the Create passkey button

A new passkey covers the sites you connect from now on. Sites that were already connected keep working with your existing passkeys. To let the new passkey approve deploys to those sites as well, reconnect them.

The Passkey added window for Work laptop, saying it covers sites you connect from now on and that 1 site already connected needs reconnecting

Each passkey on the Deploy Security page also has a Remove link. Once a passkey is removed, it can no longer approve deploys. That’s useful if you lose the device it’s on.

Approving a Deploy

When you deploy a snippet to a passkey-protected site, the review step shows each site you picked. Next, use the Active switch beside a site to choose whether the snippet runs there after the deploy. When you’re ready, click Authorize with your passkey and confirm on your device.

The deploy review for Free Shipping Notice with the Active switch on for Alex's Candle Co., marked Passkey protected, and an arrow pointing at the Authorize with your passkey button

One approval covers every site in the deploy. The approval expires after two minutes. If it runs out first, nothing is deployed, and a Try again button lets you approve the same sites again.

To lock a site so its snippets can only change this way, see our guide on using remote-only mode.

Opt-In Only Deployment

Deploying snippets from the library to your site is opt-in. When you connect a site, you choose whether to check the option that enables deploys. That way, deploys only reach the sites you choose.

You can change your mind at any time by reconnecting your site to the library. Disconnecting and connecting again without the option checked turns deploys off. Your site stays connected either way, so you can still save snippets from the plugin to your private library and use the AI features.

That’s it! You now know how to enable deploys from the WPCode Library and approve each one with a passkey. Next, take a look at our guide on 1-click installs from the WPCode Library.

Frequently Asked Questions

Below, we’ve answered some of the most common questions about deploying snippets from the WPCode Library.

Do I need a passkey to deploy?

For sites you connect with WPCode 2.4.1 or later and deploys enabled, yes. Every deploy to those sites needs your passkey. Sites connected on older versions keep deploying as before until you update WPCode on them and reconnect.

What if I lose the device my passkey is on?

Remove that passkey from the Deploy Security page so it can’t approve deploys. Then add a passkey on your new device and reconnect your sites so it can approve deploys there.

Does checking my sites need a passkey?

No. Only deploying or updating snippets needs approval. Reading a site’s list of snippets doesn’t.

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.