Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

How to Add a PayPal Donate Button in WordPress

Last updated on by
Elegant Themes
How to Add a PayPal Donate Button in WordPress

A lot of new bloggers use “PayPal donations” as one of the ways to pay the upkeep costs of running their blog. Yesterday, on twitter, one of our new followers was having an issue adding a PayPal donate button to their WordPress Sidebar. Therefore, we have decided to cover this topic thoroughly, so other users in the WordPress community can benefit also. In this article, we will show you a step by step guide on how to add a PayPal Donate Button in your WordPress posts, sidebar, or anywhere else with or without a plugin.

Live Demo of what this Tutorial will do:

Donate to WPBeginner

Initial Setup

First thing you need to do is have a PayPal account. If you do not, then create one. Next, you need to login to your PayPal account. You can do so by going to (http://www.paypal.com/login). Note: You would need to upgrade to either Premier or Business account in order to receive payments through PayPal buttons.

Once you are logged in, click on the Merchant Services button in the primary horizontal navigation area. Then click on the Donate link under the Create Buttons heading.

Paypal Merchant Services Page

Now let’s create a Donate Button.

PayPal Create a Donate Button

Once you are done filling out, click on Create Button. Then, you will be prompted to 2 sets of codes: Website or Email. We believe that the email option is the least intrusive, so we recommend that you use this option. By going with this option, it will even work on WordPress.com powered sites. When you click on the Email tab, you will see a link. Copy this link:

PayPal Link for the Donate Button

Now, login to your WordPress admin panel. We will show you how you can add it in a post/page, or how you can add it in the sidebar.

How to Add PayPal Donate Button in WordPress Posts or Page

Click on Create a New Post or Page. You can also add this in an existing post. You would need to go to the HTML Editor instead of the visual editor. So please make the switch. Now let’s add an image for the PayPal button. Below are the codes for some of the official ones:

<img src="https://www.paypal.com/en_US/i/btn/btn_donate_LG.gif" alt="" />

<img src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt="" />

<img src="https://www.paypal.com/en_US/i/btn/btn_donate_SM.gif" alt="" />

<img src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="" />

<img src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" alt="" />

<img src="https://www.paypal.com/en_US/i/btn/x-click-but11.gif" alt="" />

If you don’t like any of these images, then feel free to create your own and add it in the post. Now, you need to make the image a button. This is when you would need the link that you got from PayPal in the Email Tab. Select the image, and make it link to your Donate Link. An example code would look like this:

<a href="Your Email URL that you got from PayPal" target="_blank" rel="nofollow"><img src="The Image URL" alt="" /></a>

That’s it :) Now you should be able to see a PayPal button in your post or page that actually works.

How to Add PayPal Donate Button in a WordPress Sidebar

Let us walk you through, how you can add the PayPal Donate button in your theme’s WordPress Sidebar. You need to make sure that your theme is widget ready. You can find this out by going to Appearance » Widgets. There you will see bunch of registered widget locations toward the right. Drag the Text widget to the appropriate sidebar, and then add the code like this in there:

<a href="Your Email URL that you got from PayPal" target="_blank" rel="nofollow"><img src="The Image URL" alt="" /></a>

PayPal Donate Button in WordPress Widgets

Save the widget, and you are good to go.

PayPal Donate WordPress Plugins

Now, if you like to use the plugins method, there are few plugins that lets you do exactly what we accomplished in this article.

PayPal Donations – Easy and simple setup and insertion of PayPal donate buttons with a shortcode or through a sidebar Widget. Donation purpose can be set for each button.

Donate Plus – Donation form. Recognition wall. Donation total tracker. PayPal integration.

Multi-Currency PayPal Donations – Receive PayPal donations through WordPress in multiple currencies with the lowest possible fees. (Note: this plugin is good only if you have multiple PayPal accounts in numerous countries. Good for larger organizations).

Live Demo of this Tutorial

Donate to WPBeginner

Please consider following through the process to help us out, and see how exactly it works. You don’t have to make a huge donation ;)

Sources

WordPress.com Support
PayPal


Editorial Staff at WPBeginner is a team of WordPress lovers led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »

Comments

  1. Shara says:

    Hello. I have followed your instructions for adding the donate button to my side bar but it is not activated. When I click on the button nothing happens. Any advise would be greatly appreciated.

    Thank you so much!

  2. Sagar P says:

    So can the people who don’t use Paypal would also be able to donate right?

  3. Tech Punk says:

    Thank you for your help. It works great.

  4. Tessa Rathsack says:

    I know this is a super old post, but I just wanted to take a sec to thank you! I’ve been driving myself crazy trying to figure this simple thing out. I kept trying to copy/paste the “website” code into the widget, which obviously didn’t work. Thanks again!

  5. Ms. Kisha says:

    I added the ‘donate’ button to a page on my site but it is not displaying correctly. It is huge and extremely pixelated. Any suggestions on how to fix this? Thank you!

  6. Peter says:

    You could add tinyCoffee ( http://wordpress.org/plugins/tinycoffee/ ) to your list of PayPal donation button plugins. It is really easy to setup and and looks much more elegant than the default ones.

  7. Marcus says:

    So, I want to add a “donate” button to my blog so that I may expand later and use the money to buy vB 5 or something of the kind.
    However, PayPal only allows non-profit organizations to use their donate feature from what I have seen.
    How do I solve this?
    Thanks in advance.

  8. Rich Pickens says:

    Thanks, the button shows up and works but there is some extra code showing either side of it. I replaced the code in blue in this string:

    for the 2 URL bits but didn’t know what I am supposed to put for the “_blank’ del and “nofollow” bits…I am guessing this is the issue the extra code is “” after it…

    Thanks in advance for your help!

    • WPBeginner Support says:

      Rich Pickens, you only need to enter your email URL and don’t change any thing else.

  9. Rey says:

    Hi there.. I’m trying to use my custom Donate button and replacing the default PayPal button, for some reason it’s not displaying correctly, the border appear but I have specified border=”0″. Also the image is shrink though I used width=”value” and height=”value”. Hope you can help, thanks much.

  10. soniya says:

    i want to add paypal after login the user
    how can i add this
    plz help me
    i have text tyep member then opn a login page afetr login opn payapal process page
    how is it possible

    • WPBeginner Support says:

      You might need to create a custom page template for the page with the paypal donation button. In the custom page template you can put conditional tags to check a user’s logged in status and show them a paypal button, like this:

       <?php
      if ( is_user_logged_in() ) {
          echo 'your paypal button code here';
      } else {
          echo 'Please sign in to see the Payment options';
      }
      ?> 
      
  11. Kristin says:

    Once my Donate button on my WordPress sidebar takes me to the PayPal donation page, my email address shows up as the default email in the “Log In To PayPal” box. Is there any way to leave the email box blank instead? I would prefer that my email address not show up.

  12. Sabine says:

    So easy and straightforward with your step by step guide! Thanks.

  13. vivian says:

    For some reason i only see 3 options under {choose a button type}: 1.shopping cart, 2.buy now, and 3.subscription? I don’t see donation btn. Are they the same thing?

    • vivian says:

      I just figured out paypal has different options for different countries. However, I have another question, How do you really use “Use my secure merchant account ID” to protect email address? Under “Merchant account IDs ” I chose this option “Use my secure merchant account ID” instead of “Use my primary email address xxxxx” for security purpose. After I Copy/paste the code and test out the donate btn, it took me to “pay with paypal page”, but i see my email displayed “huge” on the top left corner. I see some blogs have their logo display there instead of email address. How do I do that? I really don’t want junk mails. Thank you!!

  14. Beate Smock says:

    Very good and THAN the button appears and it doesn’t work.

    • Editorial Staff says:

      What doesn’t work in the button? It doesn’t open a donation link or what. Can you please elaborate a bit more, so we can help.

  15. Athman says:

    Thank you so much. This has really helped me.

  16. T.Seekins says:

    Thank you so much!

  17. Nizam Khan says:

    Wow! This is awesome and very useful info. It is easy to follow with this step by step process. Thanks a lot for sharing and tweeted :)

  18. Delany Martinez says:

    Thank you, thank you, thank you. I was tearing my hair out before I had the good sense to Google how to get the button up there. You guys rock!

  19. Valerie says:

    Hi! Thanks so much for this! Do you know how to center it in the sidebar?

  20. Dan Taylor says:

    You are the bomb. Just posted a Donate button in my wordpress sidebar, your tip worked the first time. Thanks a lot man, good looks.
    Half Green Records

  21. Jennifer says:

    Hi,
    I’m trying to implement a donation code on my wordpress blog. When I press save after pasting the code into the text widget, the code instantly shortens and then nothing shows up. What am I doing wrong? Please help! :)

    • Editorial Staff says:

      The text widget is not suppose to shorten anything. Are you using the sidebar text widget? This could be an issue with a plugin.

  22. Stephen says:

    The “Donate” button is only to be used by charities and non-profit corporations. If you do other wise, PayPal will freeze your account. See their rules.

    • Editorial Staff says:

      I suppose if that is true, then all the plugin developers with donate button should get their accounts banned.
      -Syed

  23. Madison says:

    Hi, I am having a problem with the code above. The code where you can post it on a page or post. I was trying to post my code on a page, and the image shows up,but it is not functioning. The image is the only thing that shows up the button does not work I copied the code and tried to link them together,but nothing is working. Am I doing the code right? Could I send you my code or something and maybe you or someone can fix it?

    • Editorial Staff says:

      If you are just pasting the image code, then it would just show the image. You have to combine the image code and the link code.

  24. Dave Stevens says:

    The above code works. However, I am having a problem with using the PayPal return URL under the advance section. I have created a WP page to return with a thank you message. However, the PayPal return is sending the user back to the home page of the WP site. It has replace my http://www.kingsportsavealife.com/?page_id=62 with a return link code for the PayPal page that indicated that the donation has been made. Any idea how to get PayPal to send to the WP page that I want to show? Thanks

  25. Marno says:

    Thanks!  Worked great.

  26. intellexity says:

    this is a great post – seriously it was frustrating me to the extent where i was about to pack in WordPress – thanks for the information!

  27. LoveNevaeh says:

    Hi, I am having trouble with this!! :( Please can someone help!!!

  28. RajeshPatel says:

    Get free 30 Paypal Donate Buttons @ http://www.nichewp.com/30-paypal-donation-buttons.html

  29. Bob says:

    I followed your steps TO THE LETTER for putting a donation button in the side bar. It DOES NOT work! It shows up as a LINK!

    What you forgot to tell people is that this only works IF you are on wordpress.org – the PAID one and not wordpress.com – the FREE one.

  30. Bet says:

    I know you are mostly geared for bloggers, and this article focuses on donations for support. But I run a WP website for my business. What would be the best way for me to put a PayPal button on my site that would let my clients pay their invoices from me? Those might be all kinds of different amounts– how can the client enter the exact amount of their bill? I don’t see any option in PayPal for the user to enter an amount except in a “donation” button, and these are definitely not donations!

  31. Paulo says:

    Thank you for this, I’d been meaning to add a donate button to my site for a while. Have it done now in less than 5 minutes. Cheers!

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.