How to Add a PayPal Button to Your Website
PayPal builds the button for you: sign in, open paypal.com/donate/buttons for a Donate button, and finish the wizard to get a code that contains your hosted_button_id. Paste that code, or just the ID on builders that ask for it, where the button should appear. Test with a small real payment or PayPal's sandbox first.
| Donate | Buy Now / checkout | |
|---|---|---|
| Amount | Visitor can choose, or you suggest one | Fixed price you set per item |
| Typical use | Charities, creators, tip jars | One product, ticket or deposit |
| Shipping and tax | Not collected | Can be configured per button |
| Account | Business account gets a hosted_button_id; personal accounts use the business email | Business account |
Updated
PayPal buttons are the quickest way to take money without building a store. The button sends the visitor to PayPal (or opens a PayPal window over your page with the Donate SDK), PayPal takes the payment, and the money lands in your account. Your website never handles card details.
Add a PayPal button on We.Inc, WordPress, Wix, Squarespace or plain HTML
We.Inc
- Create the button in PayPal and copy its hosted button ID.
- From the ... menu, open Add-ons and pick PayPal Donate, or PayPal checkout for a fixed price.
- Paste the ID into the add-on's field and switch it on.
- Ask in the AI chat where it goes, for example 'put the PayPal donate button under the About section'.
- Publish, then click the button on the live site to check it opens PayPal.
WordPress
- Copy the code PayPal generates for your button.
- Add a Custom HTML block where the button should be.
- Paste the code and Update the page.
- Alternatively install PayPal's official plugin for WooCommerce if you are building a full store.
PayPal's Donate SDK uses a script tag, which WordPress.com only keeps on paid plans with plugins and hosting features turned on.
Wix
- In the Editor, click Add Elements, then Button, then PayPal Buttons.
- Drag the Donate or Buy Now button onto the page.
- Click it, choose Add PayPal Info and pick Donating or the purchase option.
- Enter your PayPal email, organisation name, currency and amount settings.
Wix's PayPal button needs a PayPal Business or Premier account.
Squarespace
- Copy the PayPal button code.
- Edit the page and add a Code block.
- Paste the code and save.
- Check it on the live site; code blocks show a placeholder in the editor.
Code blocks only run JavaScript on the Core, Plus or Advanced plan. On other plans, use a button block that links to your PayPal donation link instead.
Plain HTML
- Add an empty div with an ID where the button goes.
- Include PayPal's donate-sdk.js script below it.
- Call PayPal.Donation.Button with your hosted_button_id and render it into the div.
- Test with env set to sandbox, then remove it and swap in the live ID.
PayPal's Donate SDK pattern
Donate button rendered by the SDK
This is the shape PayPal documents. Swap in your own ID; while testing, PayPal's sample adds env: 'sandbox' and a sandbox ID.
<div id="donate-button"></div>
<script src="https://www.paypalobjects.com/donate/sdk/donate-sdk.js" charset="UTF-8"></script>
<script>
PayPal.Donation.Button({
hosted_button_id: "YOUR_HOSTED_BUTTON_ID",
image: { src: "https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif", alt: "Donate with PayPal" }
}).render("#donate-button");
</script>Sources
Checked October 28, 2026: the PayPal button pages we read.
- PayPal developer docs for the Donate SDK: https://developer.paypal.com/sdk/donate/
- Wix Editor PayPal Donate button setup: https://support.wix.com/en/article/wix-redigerare-konfigurera-din-paypal-donationsknapp
- Wix Editor PayPal Buy Now button setup: https://support.wix.com/en/article/setting-up-your-paypal-buy-now-button
- Squarespace code block plan requirements for scripts: https://support.squarespace.com/hc/en-us/articles/206543167-Code-blocks
Hosted button ID versus raw HTML
Older tutorials paste a long HTML form with your email address in a hidden field. Hosted buttons are safer: the price and settings live in your PayPal account, so nobody can edit the page source to change the amount.
The Donate SDK is PayPal's current pattern for donations. It loads one script from paypalobjects.com and renders the button into a container you choose.
How it works
- Decide between Donate and a fixed-price checkout button.
- Create the button inside your PayPal account and note the hosted button ID.
- Paste the code or ID into your site.
- Make a test payment in the sandbox or a small live one and refund it.
- Set where PayPal sends people after paying, such as a thank-you page.
Tips
- Sandbox button IDs do not work live. PayPal's docs say to create new hosted buttons in the live account before launch.
- A charity label is not automatic. Registered charities should enrol in PayPal's charity programme so donors see the right wording and receipts.
- Place the Donate button next to a sentence on what the money pays for. A bare button converts poorly.
- PayPal payments made through a Wix PayPal button go straight to PayPal, so they will not show in your Wix dashboard; reconcile in PayPal.
Frequently asked questions
Can I add a PayPal Donate button with a personal account?
PayPal's Donate SDK accepts a business value (your email or payer ID) for personal accounts instead of a hosted_button_id. Wix's PayPal button element requires a Business or Premier account.
Does the PayPal Donate button cost anything?
Creating the button is free. PayPal charges its standard fees on each payment received; check the fee page for your country and whether you qualify for charity rates.
Can the donation open without leaving my site?
Yes. PayPal's Donate SDK shows the donation flow in a pop-up over your page instead of redirecting to a PayPal donation page.
Should I use PayPal or Stripe?
Many buyers trust PayPal and some prefer not to type a card. Stripe gives more control over checkout. Plenty of sites offer both; our Stripe vs PayPal guide compares fees and features.
Related: Stripe vs PayPal, Accept payments on a website, Stripe payment links, HTML embed code generator, Sell digital products.
Start for free or see all free tools. We.Inc is free to start, with no card needed. AI building is on paid plans from $20 a month.
More in Guides
- How to Add Phone and Email Links to Your Website
- How to Add the Pinterest Tag to Your Website
- How to Add Plausible Analytics to Your Website
- How to Add a Popup to Your Website
- How to Add PostHog to Your Website
- How to Add a Privacy Policy to Your Website
- How to Add Schema Markup to Your Website
- How to Add a Search Bar to Your Website
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App