Integrating payment processors with WordPress can be frustratingly complex. After struggling with the official Lemon Squeezy plugin’s authentication issues, Content Security Policy errors, and endless troubleshooting, I discovered a simpler, more reliable method that actually works.
This guide shares my journey from plugin frustration to a working solution that took my digital product store live in minutes instead of days.

Step #1. Identify Why the Official Plugin Fails
The official Lemon Squeezy WordPress plugin often fails during authorization due to Content Security Policy (CSP) restrictions. This creates a frustrating cycle:
- You click “Authorize” in the plugin
- Your browser blocks the form submission
- Error messages mention “form-action” policy violations
- No matter what browser you use, the same error persists
I tried multiple approaches to fix this:
- Deactivating security plugins like Loginizer
- Modifying .htaccess to allow connections to lemonsqueezy.com
- Adding CSP headers to permit form submissions
- Deactivating LiteSpeed Cache and other plugins

Pro tip: Check your browser’s console (F12) to see exactly which security policy is blocking the connection.
Step #2. Install Fluent Snippets for Custom Code
Rather than continuing to fight with the plugin, I switched to a direct JavaScript approach using Fluent Snippets:
Detailed instructions:
- Install the Fluent Snippets plugin if you don’t already have it
- Go to WordPress Dashboard → Fluent Snippets → Add New
- Name your snippet “Register Lemon.js on Product Pages”
- Select PHP as the snippet type
- Ensure the snippet is active for the whole site

Pro tip: Fluent Snippets is ideal for this task because it lets you add custom code without modifying your theme files.
Step #3. Add the Lemon.js Registration Code
Now we’ll add code that loads the Lemon Squeezy JavaScript only on product pages:
Detailed instructions:
- Paste this code into your Fluent Snippets editor:
/**
* Register Lemon.js pada halaman produk
* Untuk digunakan dengan Fluent Snippets
*/
// Tambahkan script lemon.js hanya pada halaman produk
function register_lemonjs_on_product_pages() {
// Cek jika halaman saat ini adalah singular 'product'
if (is_singular('product')) {
// Enqueue lemon.js dari source resmi
wp_enqueue_script('lemonjs', 'https://app.lemonsqueezy.com/js/lemon.js', array(), null, true);
}
}
add_action('wp_enqueue_scripts', 'register_lemonjs_on_product_pages');
- Click “Save Changes”
- Check that the snippet is published and active

Pro tip: Fluent Snippets is ideal for this task because it lets you add custom code without modifying your theme files.
Step #4. Get Your Lemon Squeezy Checkout Link
Now you need to get the proper checkout link from your Lemon Squeezy dashboard:
Detailed instructions:
- Log in to your Lemon Squeezy account
- Navigate to Products → Select your product
- Click the “Share” button in the top right
- Select “Checkout Overlay” tab
- Toggle any options you want enabled (store logo, product media, etc.)
- Copy the HTML code provided

Pro tip: The “embed=1” parameter in the URL is crucial as it enables the overlay checkout experience instead of redirecting to a separate page.
Step #5. Add the Checkout Button to Your Product Page
Finally, implement the checkout button on your WordPress product page:
Detailed instructions:
- Edit your product page in WordPress
- Add an HTML block or button block where you want the checkout button to appear
- Paste the code you copied from Lemon Squeezy
- It should look something like this:
<a href="https://yourstorename.lemonsqueezy.com/buy/12345-your-product-id?embed=1" class="lemonsqueezy-button">Buy Now</a>
- Publish or update your page

Pro tip: You can style this button using custom CSS in your theme or by adding inline styles to match your site’s design.
Conclusion
By bypassing the problematic official plugin and implementing Lemon Squeezy directly with JavaScript, you can have a working digital product checkout in minutes instead of hours of troubleshooting. This approach is not only more reliable but also gives you greater control over the checkout experience and button styling.
The next time you’re facing integration issues with a WordPress plugin, remember that sometimes the simplest approach—loading resources directly—can be the most effective solution.