How to Create a PayPal Subscription Button in WordPress

In my PayPal Button plugin there are certain shortcode parameters that you can use to create a PayPal subscription button and accept recurring payments from your WordPress site.

recurring subscription button created with wp paypal website payments standard wordpress plugin

PayPal Subscription Button Parameters

Before getting into adding a shortcode lets take a look at the parameters available for a subscription/recurring payment button.

Button

Type of payment button. For a subscription button you need to specify button=”subscribe”.

a3

Regular subscription price. This would be a numeric value.

p3

Regular subscription duration between each billing. This would be a numeric value based on t3.

t3

Regular subscription units of duration. Allowable values are:

  • D – for days; allowable range for “p3” is 1 to 90.
  • W – for weeks; allowable range for “p3” is 1 to 52.
  • M – for months; allowable range for “p3” is 1 to 24.
  • Y – for years; allowable range for “p3” is 1 to 5.

Src

Settings this value to 1 will make a subscription payment to recur. You don’t really have any reason to set this to 0. But if you do so the payment will not recur, which means it will be a one-time payment (like a buy button).

Srt

Number of times a subscription payment will recur. This would be a numeric value with a range of 2 to 52. You don’t need to specify it if you want the subscription to continue until cancelled.

Subscription with No Recurring Times

Example 1

[wp_paypal button="subscribe" name="My product" a3="2.99" p3="1" t3="M" src="1"]

If your currency is USD, It means $2.99 USD for each month. The subscription will continue to recur until cancelled.

Example 2

[wp_paypal button="subscribe" name="My product" a3="3.50" p3="2" t3="W" src="1"]

If your currency is USD, It means $3.50 USD for each two weeks. The subscription will continue to recur until cancelled.

Subscription with Recurring Times

Example 1

[wp_paypal button="subscribe" name="My product" a3="2.99" p3="1" t3="M" src="1" srt="4"]

It means $2.99 USD for each month, for 4 installments. After this the payment will not recur anymore.

Example 2

[wp_paypal button="subscribe" name="My product" a3="3.50" p3="2" t3="W" src="1" srt="6"]

It means $3.50 USD for each two weeks, for 6 installments. After this the payment will not recur anymore.

Subscription with Trial

You can use some additional parameters to offer a trial with your recurring/subscription payments.

a1

Trial period price (similar to a3 parameter). In order to offer a free trial you can specify 0.

p1

Trial period duration (similar to p3 parameter).

t1

Trial period units of duration (similar to t3 parameter).

Example 1

[wp_paypal button="subscribe" name="My product" a1="1.99" p1="10" t1="D" a3="2.99" p3="1" t3="M" src="1" srt="4"]

It means $1.99 USD for the first 10 days, then $2.99 USD for each month, for 4 installments. After this the payment will not recur anymore.

Example 2

[wp_paypal button="subscribe" name="My product" a1="1.49" p1="1" t1="M" a3="3.49" p3="1" t3="M" src="1"]

It means $1.49 USD for the first month, then $3.49 USD for each month. The subscription will continue to recur until cancelled.

Subscription with Free Trial

Example 1

[wp_paypal button="subscribe" name="My product" a1="0" p1="1" t1="M" a3="2.99" p3="1" t3="M" src="1"]

It means free for the first month, then $2.99 USD for each month. The subscription will continue to recur until cancelled.

Subscription with Trial 2

You can use some additional parameters to offer a trial 2 with your recurring/subscription payments.

a2

Trial period price (similar to a1 parameter). This parameter can only be specified if you also specify a1.

p2

Trial period duration (similar to p1 parameter).

t2

Trial period units of duration (similar to t1 parameter).

Example 1

[wp_paypal button="subscribe" name="My product" a1="1.99" p1="10" t1="D" a2="2.99" p2="1" t2="W" a3="3.99" p3="1" t3="M" src="1" srt="4"]

It means $1.99 USD for the first 10 days, then $2.99 USD for one week, then $3.99 USD for each month, for 4 installments. After this the payment will not recur anymore.

Example 2

[wp_paypal button="subscribe" name="My product" a1="1.49" p1="1" t1="M" a2="2.49" p2="1" t2="M" a3="3.49" p3="1" t3="M" src="1"]

It means $1.49 USD for the first month, then $2.49 USD for one month, then $3.49 USD for each month. The subscription will continue to recur until cancelled.

The subscription button can be customized further using the Variable Subscription extension. It can also be used to accept recurring donation payments.

Check out the PayPal Button Plugin page for more information.

77 thoughts on “How to Create a PayPal Subscription Button in WordPress”

  1. Does this also work for recurring donations?

    Reply
    • @Carolynne, It’s for accepting subscription payments. Donation is a different type of payment method.

      Reply
  2. Is there a button to cancel subscription payments?

    Reply
    • @Adriano, Not the at the moment unfortunately. However, your customer will be able to cancel from their PayPal account.

      Reply
  3. Great plugin!

    2 questions:

    Does this catch the logged in member’s username who paid for subscription? If not, how can that be included?

    Thanks!

    Reply
    • @Girl, Unfortunately it doesn’t track any logged in username. However, the email address used to make the purchase should be included in the orders menu.

      Reply
  4. Thanks.

    An issue with that though is if the member has a different paypal email than the one they used on the site.

    Which database table does it store the payments?

    Reply
    • @Girl, It doesn’t have a database table. The plugin uses WordPress custom post types.

      Reply
  5. Hi, is there a way I can center the Paypal subscribe button?

    Reply
  6. Hi, what if we want the subscription to always occur and not end, so the subscriber would just to cancel on their own? What is the shortcode for a monthly subscription of $5 per month that never ends?

    Reply
  7. Never mind that last comment. I got my answer. You can delete that last comment.

    Edit this comment to: “Great plugin and it works well. Also, your documentation is easy to understand”.

    Reply
  8. Can I can change to “Button Text” from “Subscribe” to something else, like if I want to change this into French language, can I do this?

    Reply
    • @Barjinder, You can actually use a custom button image in the shortcode.

      Reply
  9. Hello. Looks great. But is it possible to set a trial period for 7 days and then monthly subscription for 20 USD. How would a string like that look like? Is the one below correct?
    And what I want its to be set to EUR instead of USD?

    [wp_paypal button="subscribe" name="My product" a1="0" p1="1" t1="W" amount="20.00" recurrence="1" period="M" src="1"]

    Reply
    • @Staffan, It looks good. You can add the “currency” parameter in the shortcode to use a different currency. For example:

      [wp_paypal button="subscribe" name="My product" a1="0" p1="1" t1="W" amount="20.00" recurrence="1" period="M" src="1" currency="EUR"]

      Reply
      • And what will happen after a week? Will the subscription just continue with the payment if the user haven’t unsubscribed via PayPal?
        And will I get an e-mail from PayPal when a new subscriber is subscribing or unsubscribe? Or how can I tell if the subscriber is still doing it or not?

        Reply
        • Does anyone have an answer to my question above?
          “And what will happen after a week? Will the subscription just continue with the payment if the user haven’t unsubscribed via PayPal?
          And will I get an e-mail from PayPal when a new subscriber is subscribing or unsubscribe? Or how can I tell if the subscriber is still doing it or not?”

          Reply
          • @Staffan, Yes it should automatically charge the customer after the free trial. I don’t know whether PayPal will send a confirmation email because I haven’t really tested this feature.

  10. Hi is there a way that the user will pay and recurring it until 16months, then it will email the user if they want to continue to pay for another 16months? Thanks

    Reply
    • @Driel, I don’t think PayPal has this option at the moment.

      Reply
      • How about when I set the shortcode to Recurrence until 16months?, is it gonna stop automatically or gonna execute the process again to the beginning?

        thank you for responding so quickly

        Reply
        • @Driel, That should work fine I believe.

          Reply
  11. Thanks so much. At least, I understand clearly how it works. The examples are actually useful.

    Reply
  12. Is there a way to add quantity and tax as a parameter to the subscribe button? I’ve tried adding tax but it does not appear upon checkout. I’ve tried the below two shortcodes for tax but they only show $49.21 when the customer is taken to PayPal. As a workaround, I’ve changed the product name to state that tax is included but I would much rather a proper way to account for tax and provide the customer with the ability to purchase more than one subscription.

    [wp_paypal button="subscribe" name="Soap Club Monthly Subscription plus tax" amount="49.21" recurrence="1" period="M" src="1" tax="1.00"]

    and I’ve also tried
    [wp_paypal button="subscribe" name="Soap Club Monthly Subscription plus tax" amount="49.21" tax="1.00" recurrence="1" period="M" src="1"]

    Any assistance will be appreciated.

    Thanks,

    Amy

    Reply
  13. Hi, how will I know if a user cancels his subscription on PayPal? Because I would want to cancel his service if he stops paying!

    Reply
  14. Things don’t appear to be working at the moment. Please try again later. on click the “Subscribe using a debit or credit card”. Why this is show .

    Reply
  15. I installed the plugin, enter my paypal email and saved the settings.

    I am now trying to paste the ShortCode [wp_paypal button="subscribe" name="My product" amount="1.00" recurrence="1" period="M" src="1"] into a payment page. However, when I go to that page, it does not show the button (or anything related to this button) on the page. Just blank.

    What am I missing?

    Reply
    • @Rob, You mean you inserted that shortcode into a WordPress post/page? Are you using the new block-based editor or the classic editor?

      Reply
  16. Salam,
    Can I combine these shortcodes?
    For example; i need subscription button to be opened in new tab & %5 tax so the shortcode shall be as = [wp_paypal button="subscribe" name="Tech" amount="3.99" recurrence="1" period="W" src="1" tax_rate="5.00" target="_blank"] = meaning Tech named product to be subscribed for 5.00$ per week with %5 tax to be added on each payment & the payment will be done on new tab & the subscription will continue until it is cancelled = right?
    On the other hand; if i cant combine the listed shortcodes how to have many specs in one button (like opening on new tab + adding success page & cancel page + discounts + free trials etc)?

    Reply
    • @BPW, You cannot have multiple buttons/options in the same shortcode.

      Reply
  17. hello, is that possible to customize subscribe button, the shortcode seems only work for buy now button. If not, how can I have the button in italian?

    regards
    Lorenzo

    Reply
    • @Lorenzo, What shortcode are you using?

      Reply
      • I tried this [wp_paypal button="subscribe" name="Dominio e hosting base" amount="50" recurrence="1" period="Y" src="1" button_image="https://www.eclecticweb.design/wp-content/uploads/2020/01/paga-adesso.png"] but doesn’t work, while it works if the button is wp_paypal button=”buynow”

        Reply
        • Sorry now it works, the formatting was wrong

          Reply
  18. I have the following code but for some reason it is not occurring as “recurring subscription” in PayPal and yet it seems to have the correct parameters. Every thing was fine until the latest WPPayPal update.

    The page is the Clan Business and Membership link on the header.

    Can you assist?

    Thank you,
    Chris

    [wp_paypal button="cart" name="Family Subscription-email newsletter" amount="30.00" recurrence="1" period="Y" src="1"]

    Reply
    • @Chris, button=”cart” creates an add to cart button.

      Reply
      • Thanks Noor.

        So does the “cart” override the “recurring” option?

        If so, any way around it, as I would like to have the “Newsletter” option separate from the “Subscription” option?

        Thanks,
        Chris

        Reply
  19. Hi Noor.
    I guess that no response from you to my question means that having a subscription payment added to the cart negates the recurring subscription option?
    Thanks
    Chris

    Reply
    • @Chris, A cart is where you can add multiple items for a one-time payment. That’s not the same as a subscription (a recurring payment). There is a separate shortcode for each type of button in this plugin.

      Reply
  20. Thanks for the clarification on that Noor.

    The WordPress PayPal payment system works very well, thank you, but a pity (form us anyway) that the cart doesn’t accommodate that flexibility, but I get it.

    Reply

Leave a Comment