Clavem

Selling and licensing a WordPress plugin with Stripe

WordPress.org does not allow a plugin to lock functionality behind payment or to serve its own updates, so a paid plugin is sold from your own site. Issue a key per purchase, activate it per site URL, and use the license to enable updates and support, not to disable a site that already runs your plugin.

What the directory allows, and what it does not

WordPress.org hosts a free plugin directory with strict rules, and those rules decide how you sell. Two guidelines matter most.

Guideline 5: “Trialware is not permitted.” The text says plugins “may not contain functionality that is restricted or locked, only to be made available by payment or upgrade”, and that functionality may not be disabled after a trial period or quota is met. A single listed plugin with a locked Pro tier is out.

Guideline 8: no executable code from other systems. Among the examples it lists: “Serving updates or otherwise installing plugins, themes, or add-ons from servers other than WordPress.org’s” and “Installing premium versions of the same plugin”. A directory plugin cannot update itself from your server.

What is allowed: paid functionality in a service, if all code inside the plugin is fully available, and the guidelines “recommend the use of add-on plugins, hosted outside of WordPress.org, in order to exclude the premium code”. A plugin that is an interface to a paid external service is also allowed if the service gives functionality of substance and is documented in the readme.

That leaves three shapes:

Shape Where the premium code lives License key does
Free plugin in the directory plus a premium add-on The add-on, downloaded from your site Enables add-on updates and support
Premium-only plugin, never in the directory Your site Enables updates, support and any service you run
Free plugin that talks to your paid service Your server Is checked by your service, which holds the value

Premium code that you also publish under the GPL cannot be kept secret by a key, because anyone who has the file can copy it. The directory’s licensing guideline asks for GPL-compatible code for what it hosts. Most developers therefore sell what a key can protect: updates, support, templates and a hosted service. See source-available and open-core licensing.

What is specific to WordPress

One site is one device. Use the site URL as instance_name, so the buyer recognizes it on the device page. A “1 site” license has a device limit of 1; “5 sites” has 5; “unlimited” has no limit, which Clavem supports as null.

Staging and development sites eat seats. A customer with a live site and a staging copy uses two. Decide your rule: free local and staging domains (localhost, .local, .test, a staging. prefix) or count them. If you free them, say so in your terms. Plugin activation from WP-CLI and from the dashboard should behave the same.

Check once a day, not on every page load. Run validation through a scheduled event or a transient, and keep the signed token for the rest. A plugin that calls an outside server on every request slows every visit. The WordPress guide does this with a transient.

Hosts block outgoing requests. Some hosts, and the WP_HTTP_BLOCK_EXTERNAL constant, stop a site from calling out. If the call fails, keep the last good token and show an admin notice that explains how to allow the request.

Updates come from you. A non-directory plugin hooks the update checks (pre_set_site_transient_update_plugins and plugins_api) and answers from your own release data. With Clavem, ask GET /v1/releases/:productId/latest with the key in the X-License-Key header. A valid key gets the file list with signed download links; a missing or expired key still learns that a version exists, but gets no link, so the update screen can say “renew to update”. Links last an hour, so fetch one when the admin clicks Update. See releases and downloads.

Deactivate when the plugin is deactivated. Call deactivate in the plugin’s deactivation hook, so removing a plugin from a site frees its seat. If the site is gone and cannot call, the customer removes the device on the device page.

Expiry without an outage

Make the behavior explicit:

License state What the plugin does
Valid Everything works, updates are offered
Expired or disabled Existing features keep working, updates and support are withheld, an admin notice explains how to renew
Cannot reach Clavem Trust the stored token until refresh_by; no notice before that
Over the device limit Refuse activation on the new site and link to the device page

A subscription license in Clavem expires at the end of the paid period plus three days of grace, and comes back as soon as the renewal is paid.

Setting Suggested value Why
License type Annual subscription for updates and support Plugins need ongoing compatibility work
Device limit 1, 5 or unlimited, by price tier Maps directly to site counts
Trial A free plugin or a refund window rather than a locked trial Trialware is not allowed in the directory
Updates Releases endpoint behind the key The plugin’s update filters call it

Doing this with Clavem

Create a product per plugin, connect Stripe, and map each Stripe price, such as 1 site and 5 sites, to the product with its own device limit. Buyers get a key and an order page with the ZIP. Clavem does not handle VAT; Stripe handles the payment and you handle the tax. The WordPress plugin guide has the activation, the daily check and the update filters.

Guides to follow

Questions

Can I sell a premium version of a plugin listed on WordPress.org?

Paid functionality in a service is allowed, and the guidelines recommend add-on plugins hosted outside WordPress.org to keep premium code out of the directory. They do not allow locking features in the listed plugin behind payment or an upgrade, and they do not allow it to install or update from other servers.

What happens to a site when its license key expires?

Let the plugin keep working and stop offering updates and support. Switching off a plugin a customer's site depends on turns a renewal reminder into an outage.

Sources

  1. WordPress.org Detailed Plugin Guidelines (checked November 2026)