Pinterest is going hot these days. On Pinterest, you can pin your favorite things and others can comment, like or re-pin your pins. You can also categorize your pins by creating different Boards.
Now, if you run a blog or website, you might have been wanting to add Pinterest button to website to help your readers directly pin the posts to their Pinterest Boards. We always talk about the advantage of providing social share buttons on your website or blog posts, it is really helpful to spread word directly from the source. Pinterest, even being the latest concept in Social media, has provided users more referrals than some of the top Social websites like YouTube and Google+.
So, it becomes important to join Pinterest and be active there, if you are a Blogger, Webmaster or Social Media junkie. Here is how to add Pinterest button to website or blog.

How to add Pinterest button to website?
Pinterest took the social thing in mind and it is officially providing Pin it button and follow button to put on websites and blogs from the first day. The follow button is just a pinterest icon with the link to your Pinterest profile, hence it is static and easy to integrate to website. Pinterest Pin it button for website is dynamic which is available in different formats and also gives the pin count in the count bubble. Here is the detailed tutorial to add Pinterest button to website or blog:
Note: You can directly grab the code for Pinterest pin it button (as well as for Pinterest Follow button) from Pinterest Goodies but it is in the standardized form without parameters like Description and media (image) to be pinned when the pin it button is pressed:
<a href="http://pinterest.com/pin/create/button/" class="pin-it-button" count-layout="none"><img src="//assets.pinterest.com/images/PinExt.png" alt="Pin it" / ></a> <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
I added parameters like Description and / or media for some popular blogging platforms, you just need to grab the code and paste it as told in the code of your website or blog:
Before proceeding, make sure you created a back-up of your site.
Pinterest Pin it button for WordPress
Go to your theme directory and open single.php in editing mode. Put the below given code just * above / below <?php the_content(); ?>:
<a href="http://pinterest.com/pin/create/button/?url=<?php the_permalink(); ?>&media=<?php if(function_exists('the_post_thumbnail')) echo wp_get_attachment_url(get_post_thumbnail_id()); ?>&description=<?php echo get_the_title(); ?>" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
Save Changes.
I’ve written a WordPress Plugin called WP Pinterest which can help you to add the pin-it button to your WordPress site the easiest possible way. Besides, you can add Pinterest follow button and Pinboards to your blog. Install it automatically by searching WP Pinterest in your WordPress admin’s Plugin section, or download it here.
Pinterest Pin it button for Blogger
Log in to you Blogger account and go to Blogger Dashboard » Design » Edit HTML. Click “Expand Widget Templates” textbox. Find <b:includable id='shareButtons' var='post'> paste the following code just below it:
<a class='pin-it-button' count-layout='horizontal' expr:href='"http://pinterest.com/pin/create/button/?url=" + data:post.url + "&description="+data:blog.title'>Pin It</a> <script src='http://assets.pinterest.com/js/pinit.js' type='text/javascript'/>
Save Template. If it shows error message like:
More than one widget was found with id: Navbar1. Widget IDs should be unique.
Just find Navbar1 (it could also be Navbar2 or Navbar3, just find the same it has reflected in the warning) and replace it with Navbar2 (or a different one like Navbar3 or Navbar4). If it says Warning: Your new template does not include the following widgets:…, just click the “Keep Widgets” button. That’s it.
Pinterest Pin it button for Tumblr
Go to your Tumblr Dashboard » Edit » HTML. Find {/block:Regular} and paste the following code * above / below it:
<a href="http://pinterest.com/pin/create/button/?url={Permalink}&description={PostTitle}" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script>
Click Update.
Pinterest Pin it button for Posterous
Log in to your Posterous account and go to Manage » Theme and Customize » Advanced » Enable Advanced Theming. Now find <div class="posterous_header"> and paste the following code just * above / below it:
Posterous user Sinius recently figured out that external JavaScript is no more supported on Posterous. I too dug in this issue and found that Posterous blocks external JavaScript added by users. Due to this blocking, you will not be able to see JavaScript sculpted Pinterest Pin it button on Posterous, but no worries, here’s the solution to this problem – working Pinterest Pin it button for Posterous without JavaScript:
In your Posterous dashboard, navigate to Manage Spaces » Space Settings » Edit Theme » Advanced, and find <section class="share">, add the following code just below it:
<a href="http://pinterest.com/pin/create/button/?url={Permalink}&description={PageTitle}"><img src="http://passets-cdn.pinterest.com/images/pinit_preview_none.png" /></a>
Save Changes. You can check out the button in action here
* above / below: Wherever you want to make it appear either above the post or at the footer of the post.
You can alter the value count-layout to horizontal, vertical and none to get Pinterest button with horizontal count, vertical count button and no count respectively.
Quick Tip: Use Ctrl + F or Command + F to find the code in your browser.
Also add Facebook Like button, Facebook Share button, Facebook Send button, Twitter tweet button, Google +1 button, Buffer button and Digg button to your blog, if you haven’t added them yet.
Also see Educational Social Media Graphics and follow TechAbly at Pinterest.
I can’t add “pin it” button on posterous.
I found posterous developer’s comment.
http://developers.posterous.com/adding-pinterest-button
He said “Unfortunately, the “pin it” button won’t work since we don’t allow javascript to be placed in themes.”
Can I visit your added “pin it” button on posterous blog?
I really want add “pin it” button.
Hello Sinius.
I updated the code for Pinterest Pin it button for Posterous, in fact, I made the button static (without JavaScript) and am sure that you’ll be able to put it in your Posterous Spaces.
i have this project
work fine on desktop browser
but when i pin image from mobile browser
i m prompted to login to pinterest and then after login i m redirected to default page of pinterest rather than pinit page
the same functionality works fine on desktop browser
i m prompted for login and after that i m redirected to the pinit page rather than default page like in mobile browser
i want this to work fine in mobile browser the way it works on desktop browser
Thank you for your answer.
I added button using that method.
But unfortunately, I only use no count type button.
I hope official update to Posterous for Pinterest.
Thank you again for helping me.
I removed “Pin it” button on my Posterous.
Because that method has critical problem about page location.
I can’t solve that problem because don’t use popup method on Posterous.
So I’m waiting official update to Posterous for Pinterest.
I’m trying to add a Pin it button to each product page on my site. I used the code from their goodies page. I’ve gotten the pop up to work and the passed dynamic values to display correctly including the associated image but when I click “Pin it” it looks like it’s working but when I go to check my pins, it hasn’t worked. Any idea what might be happening here? I’m not familiar with php… Any help would be appreciated!
Hi Jennifer!
Can I have your site URL for further diagnosis?
Hi Rahul,
Thank you for responding. The url is www.localbizspotlight.com I’ve gotten it to pin with the following code:
“Pin It
” but the catalogid is not being passed to the the pin’s web link. Not having any formal schooling in this, I’m sure this is something simple that I’m doing wrong.
[catalogid] is the unique “product” identifier
[cimageurl] is the image/logo for the “product”
[ccode] is the business name
An example business is http://www.localbizspotlight.com/shopexd.asp?id=64403
Thanks again for whatever you can do :)
I am having the exact same issue on a client’s site. I am wondering if it has something to do with all the other script on the page for the shopping cart tool i incorporated into their web site. It’s driving me nuts because she really wants a Pin It button. Maybe I have to add it above the code for the “Add to Cart”?
Hi Rahul,
Thanks for all the great info. I’m still having the same problem by which I found your post: I’m trying to add a Pin It button to my site. I paste the html code into my site’s home page but the pin image/logo won’t show up with the link. Unsure about where/how to add the javascript I searched for help and found you. Apparently I’m adding the javascript to the right location but it’s still not producing the Pinterest image/logo. I have no idea whether or not my site is Posterous. Any advice?
Hi Nora!
Posterous is no more allowing users to add external scripts in the blog code, so avoid adding JavaScript based Pinterest button, just copy the code of static Pinterest button for Posterous from this post and paste it in your site’s code as per my directions. I’m sure it will work. See the demo here.
Hi Rahul,
I’d only mentioned Posterous regarding not knowing whether or not my site is Posterous because I had no idea what Posterous was. Apparently it has nothing to do with my site, which was built by a developer using Adobe Cold Fusion. If you have the time you can see the issue by going to www.ThankingOfYou.com and on the home page, next to the Facebook, Twitter and Share icons, you’ll see this little box that’s the Pinterest box/link but it has no logo. That is my problem. I don’t know why, but I can’t get the image to load. Any thoughts? I do appreciate your time :)
Nora
Hi Nora!
I read your comment really fast and replied about Posterous in hurry, sorry for that.
I have seen your site and you need to update the Pinterest button code there, just find ../assets.pinterest.com/images/PinExt.png in your website HTML and update it to http://assets.pinterest.com/images/PinExt.png
It will work for sure.
Regards.
Wow, thank you for the quick response :) I will try this today and let you know how it works out. Enjoy your day!
Nora
You too, Nora :)
Blogger says code is not parsed well. Do you have another suggestion?
Hi Danielle!
Try this code:
<b:if cond='data:blog.pageType == "item"'><a expr:href='"http://pinterest.com/pin/create/button/?url="+data:post.url+"&description=data:post.title"' class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type='text/javascript' src='http://assets.pinterest.com/js/pinit.js'></script>
</b:if>
Hello, I had put the pinterest button on our website and it was working beautifully and now it’s not working, it just shows a link that says Pin it and a blank page…any clue as to why it stopped working? I have since then removed it from out site. Any help would be greatly appreciated.
Thanks!
Hi Sara!
Please provide the URL of your site so that I can diagnose the problem.
Hi Rahul, my site is http://dazzlemeelegant.com/
Thanks!
Never mind, got it working again :)
Our’s is a newspaper website which gets updated daily.i need to add pin it button to each of my detail page for the user to share.How should i pass the url of the page or the image to be pinned as parameter.Like face book and Twitter they have a sharer.php to which we need to pass the url as parameter.is their anything like this.Its purely HTML Page
Yes, there exists a parameter to pass url with Pinterest button:
http://pinterest.com/pin/create/button/?url=http://yoursite.com/your-url…
Hope this has helped you to setup Pinterest Pin button on your site :)
Hi guys!
How can i include pin it button on each pages of my website (not cms) coded with php?
Of course, you can add Pinterest Pin it button to each of your pages. All you need is to supply the PHP function which returns the URL of your page, for example:
../create/button?url=< ?php urlFucntion(); >...Refer the button code I’ve mentioned for WordPress and modify it to add suitable PHP functions. Remove the fields that aren’t required (like &media=… ).
Hi,
I’ve been searching a long time for pinterest’s code for Blogger.
Unhappily, the code you provided did not work.
The system gives the following message:
“The reference to entity “description” must end with the ‘;’ delimiter.”
I tried the parsed code you suggested above to Danielle Grigsby and my blog disappeared.
Any solution?
Thanks.
Hi!
I’ve fixed the errors and have updated the Pinterest button code for Blogger, it is working fine for me.
Hope it will work for you too!
Hi Rahul,
thanks for the guides. But I also cannot get the pin-it button to work on my page.
The pin appears blanc and it cannot be pinned to my Pinterest Page.
Could you have a look please? I also tried all the other tutorials in the blogs I found, but none is working.
Many thanks
I really appreciate it!
Andreas
Hi Andreas!
Pinterest has fixed some bugs with the Pinterest button. It should work now as I have tested it on different platforms and it’s working for me.
Dear Rahul,
My programmer was nice and added Pinterest to my homepage.
But here is the thing I am concerned about it works to “pin” something but what it shows is this as the Pin:
“The BabYCoop.com Homepage” Which is text info. How can it pin an Image or Logo or a custom image just for it that represents something a user is trying to pin? Where in the code is it directed to what to pin or how eles does it “pin” something above or around it? The site is http://www.babycoop.com When I go to PINTEREST I see dozens of images and views and or logos not text like: The BabYCoop.com Homepage. It is better than nothing I guess.
But is it not supposed to pin an image? and how do I direct it what to pin? the site uses LAMP now need a little light on the Pin…
Hi. Thank.
How long after adding it does it takes to work?
Hi. It should work instantly.
I cannot PIN anything. It is like my pinning is frozen. When I try to pin off pinterest, it says that I was pinning to fast, and tells me to go get some tea. It also has pl1. Please tell me what I can do to unfreeze the button. THANKS…
Dear Rahul I tried to follow your tutorial to add a button to my blog when i add your code and update all i get on my blog is an Access denied in the place where the pinterest button should be. Can you offer me any help with that cheers
If it helps, I find that I get an ‘Access Denied’ if I do a pintrest button that does not have image data.
Hello John.
Seems like Pinterest was on maintenance mode that time or it’s a bug which is not in my control. Please let me know the site URL and platform where you’ve observed that problem.
Well, the problem is that I’m adding it to a development site – it’s not a page I can share with you.
Hi, hope you can help me.
I’m using a template on blogger, so I’m not sure how to correctly add this “Pin it” button.
The only way I seem to be able to get to the get where I need to, is by following the path:
Template, click on the “Edit HTML”, click “Proceed”, click on the “Expand Widget Templates”
I get almost half way down the screen when I see ““. This is followed by 20 more lines of coding.
Do I paste your line of coding at the end of all this coding or the beginning.
I have tried adding it right after this line of coding, but when I paste, more information is showing than that I copied…
By this I mean that I copied:
“Pin It
BUT the following is what pasted onto the screen:
Pin It
Read more: http://techably.com/add-pinterest-button-to-website/5310/#ixzz1wkARUHNL
(Which leads back to your web page…)
I preview the page & there is nothing…
Can you explain what I am doing wrong.
Thanks, Michelle
Hello Michelle
Sorry, I was using some scripts on the blog which add the “Read more:…” thing with the code you’re copying. I just have removed that script, you should copy the code now and place it just below >b:includable id='shareButtons' var='post'<. It should work for sure, see a working demo here: http://woofun.blogspot.com/
Thanks
Thanks so much but I’m sorry to say that it still isn’t working… in fact it doesn’t even show the button. :-(
Hey Michelle. Let me know your blog’s URL for diagnosis.
Hi there, I don’t seem to have a {/block:Regular} on my Tumblr HMTL – is there something else I can refer to instead? Thank you!
Hi,
I hope you can help… I am trying to add several pin buttons to our website so that people can easily pin our products – I would like one on every product which we sell and so the people who manage the website have asked me to find the correct code to use. I have read all the instructions and I tried this code as a test on one of the products:
It places the button, and pops up with a box,but it doesn’t actually pin anything.
I think it has something to do with the images on the site. Please can you offer some help about which code I should be using? our site is www.polarnopyret.co.uk
Many thanks for your help
LuLu
Rahul, do you have this for how we can put in PHPmotion sites. Thanks
I too do not see {/block:Regular} where can we post this so it works ?
Hi Rahul,
I am trying to add Pin It button on all product pages on our website built using IBM WCM. How do I pass dynamic URL and Image to Pin It?
Thank you.
I have gone to three “how to’s” and for the life of me I cannot get this to work and I tried 3 differnt codes although I could not find where to put a few of them. On this particular way, I can’t even find the html that you say to look for on TUMBLR which is {/block:Regular} I looked 5 times, then did a search, then had my Husband look because I thought I was going crazy but he said “Nope, not there. It does not exist in my html. I have the basic “untitled” theme. You would think it would be fairly easy. The other two “how to” pages codes were not found in my html either. I wonder what I am doing wrong?
Sorry! That was my dashboard view. My page is http://www.cataddictsanonymouse.tumblr.com/
Thank you.
Hi
I tried to pin the link with lot of parameters but its take only one parameter, how can we fix this issue, Plz can u help me
Hi! thank you a lot for this tutorial I’ll try to add Pin It button on my blog.
Hej! Thank you very much for this tutorial!!!
Thanks for tutorial… someone mentioned above that they got the message ‘access denied’ .. that is what shows up on my blog posts in the location under the header where the pin it buttong should be. Any ideas?
I’ve also now got an error coming up in my html template saying something is wrong! :( Any suggestions?!
Hey Bek!
It’s a common problem everybody is facing now and then. The problem is at the Pinterest’s end, not yours. Wait till Pinterest servers are up, the button will start working again!
Thanks :)
I don’t have much programming knowledge. i have added the pin it button to every product page on my website: http://www.perkalgifts.co.za/contra-cap-p-82622.html HOWEVER I cannot get it to automatically use the image for that product page. From what i can see it wants me to manually put in the image url for every product which i cannot do with 70000 products. please send me the code to put into the site which will automatically pull the product image and url from whatever product page one is on?
thank you
I tried to add the “pin it” for Blogger, but can’t seemed to find if it actually worked. I did not see anything new below my posts. Also, how do I link my Pinterest button to my pinterest for others to go to? I added the following HTML
i am really thank you very much because great guide for me..
Hello Rahul,
Found your website and instructions but it seems I already made a mistake and probably messed up my layout before reading I am supposed to back it up. :P Anyway, I applied the code pinterest gives preciously and didnt work. Then I started trying other sites, but nothing works. I went to my code and found the main pinterest code is still saved there. What do I do? I dont want to make MORE messes, since I never backed up the original. My blog seems ok but now Im scared Il never be ble to have a pin it button…may I ask for HELP! Thanks, Jess
Hi,
I used your codes to add” pin it” button to my blog ,the button is there but it’s not going through like if u click the pinit button it takes you to another screen where you can pin it but after clicking pin nothing seems to happening,
Plz help !!
A million thank yous! This completely solved my headaches and testing different url parameters. You are a rock star!
Hello, i used code in tumbler but error comes. other application run in blogger but not done in tumbler.
I need pinterest button for phpBB and Vbulliten Forum.
I have the Pin installed and it brings up the Create a Pin dialog box, to the Red Pin It button, but does not capture any of the images on the page. I get a Whoops! You need to upload an image or provide the ‘image_url’ parameter. I appreciate your help greatly.
Good information. Lucky me I came across your site by chance (stumbleupon).
I have saved it for later!
Hello, I already have a cutom pinterst button, all i need now is the code that will allow my followers to pin each picture I post.