Adding a PayPal Buy Now Button to your Website

Adding PayPal Saved Buttons To Your Website

If you register a PayPal Business account, you can use the Saved Buttons facility to add Buy Now (and other) buttons to your website.

Once you have created and verified your PayPal Business account you can follow these instructions to create your own buttons.

Login to your PayPal account and find the My Saved Buttons section of your Profile

Check under the Selling Preferences section.

Finding Saved Buttons in your PayPal Account

Click the link “Create new button”

How to Add a New Saved Button

Fill out the fields to create your button

There are quite a few options to work with here, so you may need to click on the PayPal help links to find out how they all work

When you have entered your payment details, click “Create Button”.

Creating a New Button

Copy the code snippet

You have 2 choices here:

  • Copy the entire HTML form code snippet (messy).
  • Copy the simple email link / URL code snippet.

We will be copying the email link because this is easier to manage in future and you don’t have to use the WordPress HTML editor. See the bottom of the page if you wish to use the HTML form code snippet.

Copying the simple email link / URL code snippet

Click on the email tab, then copy the email link to the clipboard:

Paypal Saved Button Copy Email Link

Adding the buy now image into your WordPress media library

If you haven’t already, we are going to save the PayPal “Buy Now” image into your WordPress media library so it can be used in multiple places throughout your website. If you already have the “Buy Now” image in your media library, you can skip ahead.

Right click on the “Buy Now” image, and choose “Save Picture As” (Internet Explorer) or “Save Image As” (Firefox) then save the image to your Desktop.

Then return to your WordPress Dashboard, and go to Dashboard, Media, Add new then browse to the “Buy Now” image and upload it to your media library. Give it a proper title/alt text such as “Buy Now”, then click the Save All changes button.

Inserting the Buy Now button into a page

Now edit the page that you want to add the buy now button to. Place the mouse cursor where you want to insert the button, then click the “Add an Image” button (just above the editor). Click on the Media Library” tab, then find the buy now button you uploaded earlier. Click the Show button and paste the Email link into the Link URL field:

Wordpress Media Library Insert Into Post

Ensure the size is set to Full Size, then click the “Insert into Post” button to add the buy now image (which links to the PayPal site) into your page.

Save your page.

Adding more buy now buttons

When adding more buy now buttons in future, the Buy Now image is already in your media library so you just need to:

  • Create the saved button in your PayPal account and copy the email link/URL as above.
  • Edit the page you wish to add the button to, placing the cursor where you want the button to appear.
  • Click on the Add an Image button (above the editor), click on the Media Library tab then locate the Buy Now button in your library.
  • Click the show button then paste the saved button’s email link URL into the File URL field. Make sure that the other settings are similar to above, and then insert the image into the post/page.

Viewing/editing existing buy now buttons
Edit Existing ImageWhen you are editing a WordPress page using the Visual Editor, click once on an existing Buy Now button.

An Edit Image option will appear. Click it, and you will be presented with a screen similar to the one below which allows you to see the URL that the image links to (ie the Link URL):

WordPress Edit Image Screen

For a PayPal Buy Now button, the Link URL will be a in the format:

https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=xxxxx

Where xxxxx is the unique email URL for your saved PayPal button.

Appendix – Copying the entire HTML form code snippet

Copying and Pasting the Code Snippet

Return to eCommerce How To Articles.