Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Cup
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

Så här addar du en knapp för PayPal donation i WordPress (3 metoder)

Att lägga till en donationsknapp från PayPal på din WordPress-webbplats är ett smart sätt att ta emot bidrag online. PayPal gör det enkelt, prisvärt och säkert för användare att donera. Dessutom litar miljontals människor runt om i världen redan på och använder PayPal.

Genom att lägga till den här knappen kan du uppmuntra besökare att stödja din sak eller ditt projekt med bara några få klick. Det är ett bra sätt att öka donationerna utan en komplicerad installation.

I den här guiden går vi igenom stegen för att enkelt lägga till en PayPal-donationsknapp på din WordPress-webbplats.

Adding a PayPal donate button in WordPress

Varför använda en knapp för donation från PayPal i WordPress?

Många bloggare add to PayPal donation now knappar på sina WordPress webbplatser för att hjälpa till att täcka webbplatsens löpande kostnader.

Ideella organisationer använder också sina websites för fundraising för sina ändamål. En PayPal Donate knapp ger dem ett enkelt sätt att godkänna donationer.

Experttips: Om du villha en mer komplett insamlingslösning kan du kolla in våra expertval av de bästa plugins för donationer och insamlingar för WordPress .

Innan du börjar måste du skapa ett PayPal-konto eller logga in på ditt befintliga konto.

Eftersom det här är en omfattande guide har vi skapat en innehållsförteckning så att du enkelt kan hoppa till det avsnitt du behöver:

Är du redo? Låt oss komma igång.

1. Hur man add to PayPal Donation Button i WordPress (Gratis Plugin)

Denna metod rekommenderas om du letar efter ett gratis WordPress PayPal plugin för donation. Det är enklare men mycket limit i termer av vad you kan göra.

Först måste du installera och aktivera pluginet Donationer via PayPal. Mer information finns i vår steg-för-steg-guide om hur du installerar ett WordPress-tillägg.

Efter aktivering vill du gå till sidan Inställningar ” PayPal-donationer för att skapa din donationsknapp.

Här går du vidare och anger din PayPal-e-postadress. Det här är den adress du använder för att logga in på PayPal.

Du kanske märker att donationsvalutan är inställd på US-dollar som standard. Om du vill ändra detta väljer du bara önskad valuta i rullgardinsmenyn.

Add the email address for your PayPal account to the PayPal Donations plugin settings

Sedan kanske du vill skapa en tacksida på din webbplats och ställa in den som ”retursida” i avsnittet ”Valfria inställningar”.

Du kan valfritt lägga till ett standardbelopp, syfte och referens för dina PayPal donationer.

Set the defaults for your PayPal donations

Därefter kan du välja en knappstil för donation PayPal eller enter en URL för en customize knapp image. You can also change the donation country and language, which defaults to the United States and US English.

När du är klar, glöm inte att trycka på knappen ”Save Changes” för att lagra dina inställningar.

Choose the style of donation button that you want to use on your site

Lägga till PayPals knapp för donation på din website

Pluginet gör att du enkelt kan visa PayPal-donationsknappen var som helst på din WordPress-webbplats med hjälp av en kortkod.

Redigera bara inlägget eller sidan där du vill visa donera nu-knappen och lägg sedan till kortkodsblocket i innehållsredigeraren.

Adding a shortcode block to your site to enter the PayPal Donations shortcode

Inuti settings måste du add to [paypal-donation] en shortcode. Du kan nu save dina ändringar och previewa ditt post eller page.

Här är knappen donation PayPal live på vår demo site.

The Donate button on our demo website

Detta plugin låter dig också add knappen till en sidebar eller footer widget area.

Gå bara till sidan Appearance ” Widgets från WordPress dashboard. Efter det klickar du på + knappen och add the ”PayPal Donations” widget block to your sidebar or footer.

Add donation button to sidebar

Widgeten har samma Settings, så allt du behöver göra är att ange en titel och en text. Glöm inte att trycka på knappen ”Update” för att skapa din widget.

Här är widgeten donation i vår demo website’s sidebar.

The Donate widget live in the sidebar on our demo website

2. Hur man addar till ett smart PayPal donation form i WordPress (med WPForms)

Ett annat bra sätt att skapa en PayPal-donationsknapp är med WPForms. Det är det bästa WordPress-formulärbyggarpluginet på marknaden, som används av över 6 miljoner webbplatsägare.

WPForms allow you to easily create beautiful donation forms that let you accept payments using a credit card and/or PayPal.

Den här metoden ger dig mer flexibilitet.

Du kan samla in information om givare, lägga till dem till din email list, samla in telefonnummer, run undersökningar, omröstningar och mer. Det bästa är att WPForms fungerar med alla de bästa tjänsterna för e-postmarknadsföring.

I grund och botten kan du engagera dig med användare, vilket hjälper dig att skapa en starkare gemenskap.

Note: Det finns en gratis version av WPForms Pro plugin, men du behöver Pro-versionen eller högre för att ta PayPal-betalningar.

Först måste du installera och aktivera WPForms plugin. För mer detaljer, se vår Step-by-Step guide om hur du installerar ett WordPress plugin.

Vid aktivering ska du gå till WPForms ” Inställningar för att ange din licensnyckel. Du hittar den här informationen under ditt konto på WPForms webbplats.

Entering your WPForms license key on your site

Låt oss sedan navigera till WPForms ” Tillägg.

Här måste du installera PayPal Standard Addon. Hitta det bara i listan och klicka sedan på knappen ”Installera tillägg” under den. Tillägget kommer automatiskt att installeras och aktiveras åt dig.

Installing the PayPal Standard addon in WPForms

Nu är det dags att skapa din donation form.

Gå bara till WPForms ” Add New page i din WordPress admin area för att starta form builder.

Men först måste du ange en titel för ditt formulär och sedan välja mallen ”Donationsformulär”.

Select donation form template

WPForms kommer nu automatiskt att hämta din form builder i WPForms builder. Det är enkelt att lägga till, ta bort eller ändra fälten i ditt formulär.

För att add to ett fält drar du helt enkelt fältet från menyn till vänster. Vi har add to ett multiple choice-fält för ”Hur hörde du talas om About us?”.

Edit your form template in WPForms

Därefter kanske du vill ändra knappen Submit så att det står Donation i stället.

För att göra detta kan du antingen klicka på knappen eller gå till fliken Inställningar ” Allmänt för ditt formulär . Under ”Submit Button Text” lägger du helt enkelt till texten ”Donate”.

Changing the text on the Submit button

Låt oss sedan navigera till Betalningar ” Paypal Standard för att ställa in betalningarna för ditt formulär.

Markera bara ”Aktivera PayPal-standardbetalningar” och ange din PayPal-e-postadress. Under Betalningstyp, gå vidare och välj ”Donation”.

Enabling PayPal payments for your form in WPForms

När du är klar klickar du på knappen Save för att spara dina Settings.

Experttips: Du kan skicka ett kvitto till givarna för deras donation. Ta en titt på våra instruktioner om hur du skapar ett formulär med flera mottagare för att få hjälp med detta.

Lägga till ditt donation form på din website

När du har slutfört skapandet av din PayPal donation form är det dags att add to your website.

WPForms gör det superenkelt att add to formulär var som helst på din website.

Skapa helt enkelt ett nytt inlägg eller en ny sida eller redigera en befintlig. Sedan kan du lägga till ett WPForms-block i WordPress innehållsredigerare och välja det formulär som du skapade tidigare från rullgardinsmenyn.

Creating a WPForms block and selecting your form from the dropdown list

När du är klar kan du previewa eller publicera din page för att se din donation form.

Grattis, du har nu skapat ett smart PayPal donation form i WordPress.

Viewing the completed donations form on the website

You är nu redo att ta emot donationer!

3. Så här lägger du manuellt till en knapp för donation från PayPal i WordPress (kodmetod)

Om du inte vill installera ett plugin eller om du använder WordPress.com istället för WordPress.org, kan du manuellt lägga till en knapp för PayPal donation.

Först måste du logga in på ditt PayPal-konto och gå till sidan Betala och få betalt ” PayPay-knappar.

Selecting the PayPal Buttons menu option

På nästa page ser du olika typer av knappar.

Klicka bara på alternativet ”Donation” knappen.

Select the Donate button type

Nu kan du följa instruktionerna på skärmen för att skapa din knapp.

Till exempel, select your country, language, and button style. När du är klar klickar du på knappen ”Fortsätt”.

Following the on-screen steps to create the donation button

Efter det har du några valfria inställningar.

På den sista vyn i Wizard för att skapa knappar klickar du på knappen ”Finish and Get Code”.

Finish creating your donation button and get the code for it

Du kommer nu att se en sida med en delningsbar länk.

Det här är den URL du behöver, så du vill hålla den öppen i den här fliken eller spara den på ett säkert ställe.

Getting the shareable link for your new PayPal donate button

Därefter kan du gå till ditt WordPress-adminområde och redigera ett inlägg eller en sida där du vill lägga till PayPal-donationsknappen.

Du måste add a new HTML block to your page or use the Text mode if you’re using the Classic editor.

Adding an HTML block in the WordPress block editor

Därefter klistrar du in följande kod i ditt HTML block:

<a href="Your Shareable Link that you got from PayPal" target="_blank" rel="nofollow noopener"><img src="https://www.paypal.com/en_US/i/btn/x-click-but21.gif" alt="Click to Donate" /></a>

Vi ser till att ersätta orden ”Din delbara länk som du fick från PayPal” med den faktiska länken från PayPal.

The PayPal button HTML code in the HTML block

Gå vidare och publicera din sida. Du har nu en donationsknapp för PayPal på din WordPress-webbplats utan att använda ett plugin.

Om du vill lägga till knappen för donation på andra platser på din site kan du också klistra in den här HTML-koden i en ”Custom HTML”-widget för att add to din sidebar eller andra widget-områden i ditt block aktiverade tema.

Här är ett live-exempel på knappen donation:

Donate to WPBeginner

Känn dig gratis att clicka på den för att se hur den fungerar. Du kan göra en donation för att hjälpa oss om du tycker att den här artikeln var till hjälp.

Alternativ för customize

Anledningen till att vi valde den delbara länken istället för den fullständiga koden för donationsknappen är att du enkelt kan customize donationens image.

Under finns några andra officiella PayPal donation knappar. Kopiera helt enkelt koden och ersätt image section i din huvudkod ovan.

Alternativ 1

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

Alternativ 2

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

Alternativ 3

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

Alternativ 4

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

Alternativ 5

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

Alternativ 6

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

Om du inte gillar någon av dessa images, kan du skapa din egen. Bara uploada den image till din WordPress mediabibliotek och få den direkta länken till den filen. Lägg sedan till den länken i koden under:

<a href="Your Sharable Link that you got from PayPal" target="_blank" rel="nofollow noopener"><img src="The Image URL" alt="Click to Donate" /></a>

Bästa PayPal tillägg för donation för WordPress

Vi rekommenderar PayPal Donations plugin som det enklaste sättet att add to en PayPal donation knapp till din site. Det är gratis och mycket enkelt att använda.

Om du vill samla in information från dina givare är WPForms det bästa alternativet för dig.

Alternativt, om du letar efter ett fullfjädrat WordPress-donationsplugin, rekommenderar vi att du använder Charitable. Det används av över 10 000 ideella organisationer för att skapa insamlingskampanjer och acceptera PayPal-donationer online.

Charitable

Med Charitable kan du skapa din första insamlingskampanj på mindre än 5 minuter. Det erbjuder obegränsade insamlingskampanjer, enkel givarhantering, GDPR-klara donationsformulär och mycket mer.

Det finns också en gratisversion av Charitable för att du ska komma igång.

Om du vill ha fler alternativ att välja mellan, så finns här några andra bra PayPal-donationsplugins:

Vi hoppas att den här artikeln hjälpte dig att lägga till en PayPal-donationsknapp i WordPress. Sedan kanske du också vill kolla in vår guide om hur du samlar in pengar med crowdfunding eller våra beprövade tips för bästa praxis för donationsformulär för att öka donationer.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Avslöjande: Vårt innehåll stöds av våra läsare. Det innebär att om du klickar på några av våra länkar, kan vi tjäna en provision. Se hur WPBeginner finansieras, varför det är viktigt, och hur du kan stödja oss. Här är vår editoriala process.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Den ultimata WordPress-verktygslådan

Få GRATIS tillgång till vår verktygslåda - en samling WordPress-relaterade produkter och resurser som varje professionell användare bör ha!

Reader Interactions

76 kommentarerLämna ett svar

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. Dennis Muthomi says

    a huge thank you for this tutorial article. I’ve been on the hunt for a way to accept donations from my site, but all the other articles I found online were talking about using Stripe for processing donation transactions and it is not available in my country. It’s great to see this guide that focuses on PayPal, which is perfect for my needs.
    your instructions were super clear and easy to follow. Seriously, you guys are lifesavers.

  3. Jiří Vaněk says

    I have the option to donate on the website using the elementor button. There is a button directly for paypal. At the same time, I also have WP Forms in the full version. Is it ok if I do Paypal using WP Forms? The button in Elementor is basically just a classic button with a url that leads to the possibility of paying by Paypal directly to my account.

    • WPBeginner Support says

      Yes, you are not required to use a specific method and if you wanted to you could even use multiple methods for different sections if you wanted.

      Administratör

    • WPBeginner Support says

      Apologies if it is not working for you, you may want to reach out to the plugin’s support with whatever error you are running into for them to take a look at it. We will also take a look at our article :)

      Administratör

  4. Robert says

    My blog is on WordPress.com so I attempted to follow your instructions to manually add a PayPal button. Your instructions state:

    ”Start by logging in to your PayPal account, and click on the Tools menu item”

    I cannot find the Tools menu item on PayPal. Please can you advise.

  5. Vanessa says

    Thanks for all this info. I am not clear if I need a paid version of wordpress.org if I want to add a donations button. I probably won’t be selling anything, just hope for a few donations. Thanks for your help :)

      • Vanessa says

        I have set up a wordpress.org blog by following your very clear instructions….thank you very much!! I have gone to widgets to install a paypal donations button but there does not seem to be one there to choose. Have I made a mistake?? I chose the cheapest bluehost option. Have I done something wrong?

        Also, just so you know…..when I got nearly to the end of the bluehost procedure, having followed your link to get there, intending that you got the commission for my purchase, there was another pop-up offer, which offered even more discount. I clicked on this, so I hope you have not lost the commission. If so, it is a bit of a dirty trick, which may have robbed you of your commission. I hope not. Thanks for your great advice.

  6. martha rees says

    I like the idea of the video, but my version of wordpress doesn’t let me install plugins, and so that won’t work. When I tried with the email link, I got the message that ’payment did not go through’. So I couldn’t put the button or a link on the page. Thanks

  7. Gandire says

    I can create the button image, but nothing happens when I click. I’m suspecting it wasn’t made clickable?

    • Haitham Alnaqeb says

      Did you use a plugin to create the click button? or did you copy it from PayPal itself? what is the source of the code did you use?

  8. Apata says

    Hello please engineer Sayed,
    I am worried as to how could I know or find the payment gateway that support my country Nigeria. I am still searching, but I have not found one.
    Please help me and recommend one to me.
    Thanks.

  9. Mandy says

    I have been beating my head up against a brick wall for HOURS trying to fix the oversized, pixelated donate button in my wordpress site. I finally came across this article and it was just the fix!!!!! Thank you!!!

  10. Aims says

    Thanks for this post! It’s been most helpful. But how do you create code for the image when you personalise it? I have an image , now what?!

  11. Paul Mozina says

    I got the PayPal button to work on a post, np, thanks to you. Now, how do I add the PayPal button to my main sidebar?

  12. Jen Maffett says

    I pasted the code from Paypal into my WordPress page, post and project page and in each instance it appears when I switch back to Visual, but then when I publish the code gets stripped out and nothing appears on the actual page. When I go back to the editor the code has been erased or truncated. Is there something I can do to make it ”stick”?

    I see that this happened to others in the comment string, but I didn’t see a solution mentioned.

    • WPBeginner Support says

      Basically you just need the link from the PayPal under the Email section. This is a plain URL and the code just adds the link to a donate button image. You can download the donate button image from PayPal website and upload it in post editor. Right click on it and link it to your PayPal email URL.

      Administratör

    • Leon Zak says

      Having WP mess with the code after pasting has been a problem for me also. I finally found an acceptable way that so far seems to work.

      I found putting the PayPal code in a table is working for me. I can go back and forth from visual to text and the code stays the same. I put in table tags, then for my case I put in two rows with one column (td tag) in each. In the first row I’ve put some text for the what the button payment is for and then I put the PayPal code in the 2nd row.

      The only thing I notice is a light border shows up around the table. Putting the border = 0 in the table doesn’t remove it. I think the border is getting introduced elsewhere (I”m using Elegant Themes DIVI). I don’t mind the thin border in this application so I haven’t done much work trying to find how to remove it.

      To see what it looks like – the page is one of my clients at (take the spaces out, I didn’t want this to get tagged as spam)
      Hope this helps someone with the same problem.

  13. Lucy Barret says

    This post is pretty handy for me as I was about to add PayPal buttons on my clients site. Thansk…

  14. Wll says

    Make sure to watch that you put the URL within the ” ” brackets and hit refresh button on your site, worked fine for me

  15. D. says

    Hello, I visited paypal site today and noticed that it said to only use the donation button for a fundraising cause. It said to chose another option if you are not raising money for a cause. So are we no longer able to use donate buttons on our blogs if it is not for a cause? I was hoping to raise money to help finance my blog.

  16. leoo says

    the problem is that I am not seeing PayPal Donation Button , only other buttons like , buy , add card , subrscribe etc … donation isn’t :S please help me

  17. 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!

  18. 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!

  19. 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!

  20. 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.

    • Sam says

      This may be a very old post but it’s still getting traffic so I thought I’d answer this. I also believed donate buttons were only for charities but that’s apparently not true. You can read more about it here:

      They do take a cut but I’m wondering what happens if you choose not to use the word ”donate” and instead add the word near the regular icon? I just find it absurd that everyone wants a cut of what you’re attempting to get fundraising for.

  21. 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!

  22. 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.

  23. 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';
      }
      ?> 
      

      Administratör

  24. 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.

  25. 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!!

  26. 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 :)

  27. 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!

  28. 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

  29. 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! :)

  30. 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.

  31. 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?

  32. 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

  33. 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!

  34. 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!

Lämna ett svar

Tack för att du väljer att lämna en kommentar. Tänk på att alla kommentarer modereras enligt våra policy för kommentarer, och din e-postadress kommer INTE att publiceras. Vänligen använd INTE nyckelord i namnfältet. Låt oss ha en personlig och meningsfull konversation.