# How to Sell WordPress Plugins with License Keys

> Complete guide to selling premium WordPress plugins with license key activation. Set up checkout, automate key delivery, and validate licenses with update management.
- **Author**: Ayush Agarwal
- **Published**: 2026-03-29
- **Category**: Payments, License Keys, How-To
- **URL**: https://dodopayments.com/blogs/sell-wordpress-plugins-license-keys

---

The WordPress plugin economy is massive. Premium plugins generate millions for developers every year. But setting up a license system and payment flow from scratch is a painful distraction from actually building the plugin. Most developers want to focus on code, not on building a custom billing engine or a secure license validation server.

In this guide, we will walk through the complete process of selling premium WordPress plugins with license keys. We will cover everything from choosing a monetization model to implementing a secure validation system using Dodo Payments. By the end of this article, you will have a clear roadmap for launching your premium plugin and scaling your revenue without the marketplace overhead.

## WordPress Plugin Monetization Models

Before you write a single line of licensing code, you need to decide how you want to charge for your plugin. The WordPress ecosystem has several established models that work well for different types of products. Choosing the right one depends on your target audience and the value your plugin provides.

> License key management looks simple until you need activation limits, device tracking, and expiration logic across thousands of customers. Building this yourself is a distraction from your core product.
>
> \- Ayush Agarwal, Co-founder & CPTO at Dodo Payments

### The Freemium Model

This is the most popular model in the WordPress world. You offer a feature-limited version of your plugin for free on the WordPress.org repository. This free version acts as a powerful marketing tool, reaching millions of potential users. You then offer a "Pro" version on your own website that includes advanced features, premium support, and automatic updates.

The freemium model works because it builds trust. Users can try the basic functionality before they commit to a purchase. When they are ready for more power, they upgrade to the premium version. This model requires a solid [software license management](https://dodopayments.com/blogs/software-license-management) strategy to ensure that only paying users can access the Pro features.

### Direct Sale Model

In this model, you do not offer a free version on the official repository. Instead, you sell the plugin exclusively through your own website. This is common for niche plugins that solve specific, high-value problems for businesses. Since there is no free version to act as a lead magnet, you rely on SEO, content marketing, and paid ads to drive traffic to your landing page.

### Marketplace Model

Marketplaces like CodeCanyon or ThemeForest handle the traffic and payments for you. They provide a platform where users are already looking for solutions. In exchange, they take a large commission, often ranging from 30% to 50% of every sale. You also lose direct access to your customers, making it harder to build a long-term brand.

While marketplaces are great for getting started, most successful plugin developers eventually move toward selling directly. Owning the platform allows you to implement [subscription vs license model](https://dodopayments.com/blogs/subscription-vs-license-model) experiments and keep 100% of your revenue after payment processing fees.

## Why Sell Directly with License Keys

Selling directly from your website is the gold standard for serious WordPress developers. It allows you to build a sustainable business that you fully control. License keys are the bridge that makes this possible, providing a way to verify purchases and protect your intellectual property.

### Control Your Pricing and Margins

When you sell on a marketplace, you are often forced into their pricing tiers. When you sell directly, you can charge whatever you want. You can offer tiered pricing based on the number of sites, lifetime deals, or annual subscriptions. This flexibility is crucial for maximizing your [recurring revenue](https://dodopayments.com/blogs/recurring-revenue).

### Own the Customer Relationship

Marketplaces often hide customer data from you. When you sell directly, you own the email list. You can send product updates, educational content, and cross-sell other plugins. This direct line of communication is the most valuable asset any software business can have.

### Higher Security and Update Control

License keys allow you to control who gets access to your updates. Without a license system, anyone who gets a copy of your plugin can use it forever and potentially share it with others. By requiring a valid key for updates, you ensure that only active customers get the latest security patches and features.

## Why Dodo Payments for WordPress Plugins

Setting up a license server is hard. You have to handle database management, API security, and high availability. Dodo Payments simplifies this by providing a built-in license key system that integrates directly with your checkout.

### Automated License Key Lifecycle

Dodo Payments handles the entire lifecycle of a license key. When a customer completes a purchase, Dodo automatically generates a unique key and sends it to them in a professional email. You don't have to write any code to handle the generation or delivery of keys.

This automation extends to renewals and expirations. If a customer cancels their subscription, Dodo can automatically invalidate their license key. This ensures that your [how to sell software online](https://dodopayments.com/blogs/how-to-sell-software-online) process is completely hands-off.

### Public License API

One of the biggest challenges in WordPress licensing is making API calls from the user's server to yours. Dodo provides a public License API that does not require a secret key for validation and activation. This means you can safely call the API directly from your plugin's PHP code without exposing your master API credentials.

This architecture is both secure and easy to implement. You can use the [License Keys documentation](https://docs.dodopayments.com/features/license-keys) to find the exact endpoints for activation and validation. This makes Dodo the [merchant of record for saas](https://dodopayments.com/blogs/merchant-of-record-for-saas) that actually understands the needs of developers.

### Global Tax and Compliance

Selling globally means dealing with VAT, GST, and sales tax in hundreds of jurisdictions. Dodo Payments acts as your Merchant of Record, meaning we handle all the tax collection and remittance for you. You get one payout, and we take care of the compliance headaches.

## Step-by-Step Guide to Selling Your Plugin

Now that we understand the "why," let's look at the "how." Implementing a licensing system with Dodo Payments is a straightforward process that can be completed in a few hours.

### 1. Create Your Product in Dodo

The first step is to log into your Dodo Payments dashboard and create a new product. When setting up the product, you will see an option to enable license keys. You can configure how many activations are allowed per key. For example, you might offer a "Single Site" plan with 1 activation and a "Business" plan with 5 activations.

You can also choose between one-time payments and subscriptions. Most WordPress plugins use an annual subscription model to provide ongoing updates and support. Dodo handles the recurring billing automatically, so you don't have to worry about failed payments or renewals.

### 2. Build Your Landing Page

Your landing page is where you convince users to buy your plugin. It should clearly state the problem your plugin solves and the benefits of the premium version. Use high-quality screenshots, videos, and testimonials to build credibility.

Make sure your pricing table is clear. Explain the difference between your tiers and what is included in each. This is a great place to link to your [how to accept online payments](https://dodopayments.com/blogs/how-to-accept-online-payments) documentation if you are building a custom checkout flow.

### 3. Add Dodo Checkout

Dodo offers several ways to accept payments. The easiest is to use a payment link that you can add to your "Buy Now" buttons. When a user clicks the button, they are taken to a secure, hosted checkout page that is optimized for conversions.

Alternatively, you can use the Dodo Overlay checkout. This keeps the user on your site and opens a modal for the payment. This provides a more seamless experience and can lead to higher conversion rates. You can find more details in the [integration guide](https://docs.dodopayments.com/developer-resources/integration-guide).

### 4. Automated Key Delivery

Once the payment is successful, Dodo takes over. The customer receives an email with their receipt and their unique license key. You can also redirect the customer to a "Thank You" page on your site where you display the license key and a download link for the Pro version of the plugin.

### 5. Add Activation Screen in WordPress

Inside your plugin, you need to create a settings page where users can enter their license key. This is usually done using the WordPress Settings API. You should provide a simple text input and an "Activate" button.

When the user clicks activate, your plugin will send a request to the Dodo License API. If the key is valid and has remaining activations, Dodo will return a success response. You should then store the license key and an activation instance ID in the WordPress database.

### 6. Validate via License API

Validation should happen periodically to ensure the license is still active. You don't want to check on every page load, as that would slow down the user's site. Instead, you can use a WordPress cron job to check the license once a day or once a week.

### 7. Tie License to Domain

To prevent users from sharing a single-site license across multiple domains, you should tie the activation to the site's URL. When you call the Dodo activation endpoint, you can pass the site URL as the "name" of the activation instance.

### 8. Handle Auto-Updates

One of the biggest benefits of a premium plugin is automatic updates. WordPress has a built-in system for updates, but it defaults to the official repository. To serve updates from your own server, you need to hook into the `pre_set_site_transient_update_plugins` filter.

Before you provide the update package, you should verify that the site has a valid license key. This ensures that only paying customers get the latest version of your code. You can use [webhooks](https://docs.dodopayments.com/developer-resources/webhooks) to notify your update server when a license is renewed or canceled.

## Licensing Workflow Diagram

The following diagram illustrates the complete flow from the initial purchase to the ongoing license validation and update process.

```mermaid
flowchart TD
    A[User Buys Plugin on Website] --> B[Dodo Generates License Key]
    B --> C[Key Emailed to User]
    C --> D[User Enters Key in WP Admin]
    D --> E{Plugin Calls Dodo API}
    E -->|Valid| F[Plugin Activated & Features Unlocked]
    E -->|Invalid| G[Show Error Message]
    F --> H[Daily Background Validation]
    H --> I{Is License Still Valid?}
    I -->|Yes| J[Continue Access]
    I -->|No| K[Lock Features & Show Notice]
    J --> L[Check for Updates]
    L --> M{Valid License?}
    M -->|Yes| N[Serve Update Package]
    M -->|No| O[Deny Update]
```

## PHP Code Example for WordPress

Here is a simplified example of how you can implement license activation in your WordPress plugin using the Dodo Payments API. This code uses the `wp_remote_post` function to communicate with Dodo.

```php
<?php
/**
 * Activate the license key with Dodo Payments
 */
function dodo_activate_license($license_key) {
    $url = 'https://live.dodopayments.com/licenses/activate';

    $response = wp_remote_post($url, array(
        'body' => json_encode(array(
            'license_key' => $license_key,
            'name'        => get_site_url(), // Tie to domain
        )),
        'headers' => array(
            'Content-Type' => 'application/json',
        ),
    ));

    if (is_wp_error($response)) {
        return false;
    }

    $body = json_decode(wp_remote_retrieve_body($response), true);

    if (isset($body['id'])) {
        // Store the instance ID and key in the database
        update_option('my_plugin_license_key', $license_key);
        update_option('my_plugin_license_instance_id', $body['id']);
        return true;
    }

    return false;
}

/**
 * Validate the license key periodically
 */
function dodo_validate_license() {
    $license_key = get_option('my_plugin_license_key');
    $instance_id = get_option('my_plugin_license_instance_id');

    if (!$license_key || !$instance_id) {
        return false;
    }

    $url = 'https://live.dodopayments.com/licenses/validate';

    $response = wp_remote_post($url, array(
        'body' => json_encode(array(
            'license_key'             => $license_key,
            'license_key_instance_id' => $instance_id,
        )),
        'headers' => array(
            'Content-Type' => 'application/json',
        ),
    ));

    $body = json_decode(wp_remote_retrieve_body($response), true);

    return isset($body['valid']) && $body['valid'] === true;
}
?>
```

This code provides a solid foundation for your licensing system. You can expand it by adding error handling for specific API responses, such as when the activation limit is reached or the key is expired. For more advanced implementations, check the [Dodo Payments SDKs](https://docs.dodopayments.com/developer-resources/dodo-payments-sdks).

## Tips for Successful Plugin Licensing

Implementing the code is only half the battle. You also need to think about the business logic and user experience of your licensing system.

### Single-Site vs Multi-Site Licenses

### Handling License Renewals

Subscriptions are the best way to handle renewals. By default, Dodo will charge the customer every year and keep their license active. If a payment fails, Dodo will automatically retry and notify the customer. This reduces churn and ensures a steady stream of revenue.

### Deactivation on Site Change

Users often move their sites from a staging environment to production. Your licensing system should allow them to deactivate a key on one site so they can use it on another. You can add a "Deactivate" button to your plugin settings that calls the Dodo deactivation endpoint.

## FAQ

### Can I use Dodo Payments with a free plugin on WordPress.org?

Yes. You can keep your free version on the official repository and sell the Pro version through your own site using Dodo. This is the standard freemium model used by thousands of successful plugins.

### How do I handle taxes for international customers?

Dodo Payments is a Merchant of Record. We automatically calculate, collect, and remit sales tax and VAT for every transaction based on the customer's location. You don't have to worry about tax compliance in different countries.

### What happens if a customer cancels their subscription?

When a subscription is canceled, Dodo can notify your system via webhooks. You can then choose to invalidate the license key immediately or let it remain active until the end of the current billing period.

### Is the Dodo License API secure to call from PHP?

Yes. Dodo provides public endpoints for activation and validation that do not require a secret API key. This allows you to call them safely from the client-side or from a user's WordPress server without risking your account security.

### Can I limit the number of sites a license can be used on?

Absolutely. You can set an activation limit for each product in the Dodo dashboard. If a user reaches their limit, the API will return an error when they try to activate the key on a new site.

## Final Take

Selling WordPress plugins with license keys doesn't have to be a technical nightmare. By using a dedicated platform like Dodo Payments, you can automate the hard parts of licensing, payments, and tax compliance. This allows you to focus on what you do best: building great software for the WordPress community.

Whether you are launching your first plugin or scaling an existing business, owning your platform is the key to long-term success. With the right licensing strategy and a reliable partner like Dodo, you can build a profitable, sustainable business that stands the test of time. Ready to get started? Check out our [pricing](https://dodopayments.com/pricing) and sign up for a free account today.
---
- [More Payments articles](https://dodopayments.com/blogs/category/payments)
- [All articles](https://dodopayments.com/blogs)