HowTo Add Google +1 Button in WordPress

Written by: Muninder

Updated: June, 2, 2011

We’ve already talked a lot about the +1 Button. Right from it’s Introduction as the Like Button Killer to the Vote up for Search results type button. Like, other Google products even the +1 Button has attracted some critics. They say that the +1 Button won’t be as helpful or recommendation(al) as it sounds since the voting of search results can be easily manipulated. But Google is not as stupid as you think. That’s the reason they hire only qualified people in terms of experience and education to work on their products. It has crystal clearly stated in the answer to this question on the +1 Button’s FAQ page that; these recommendations or vote-ups are personalized.
Below is the quote containing the exact answer to that FAQ of whether the Google +1 Button will have any effect on the search results.

+1 helps people discover relevant content—a website, a Google search result, or an ad—from the people they already know and trust. Adding the +1 button to your pages lets users recommend your content, knowing that their friends and contacts will see their recommendation when it’s most relevant—in the context of Google search results.

To explain it, lets take an example. Suppose that you vote up a search result using the Google +1 Button while googling. Now, when your friend who has the same question in mind as you had; googles for the solution. Then he sees a list of results on the front page and he thinks which one to choose. With the help of your +1 or vote up your friend will easily be able to select that particular result and find a solution to his problem. So, indirectly your +1 or vote helped him get the solution. That is the basic idea of the Google +1 Button.
But you need to remember one important thing that for voting up a search result or an ad you need to be signed into your Google Account. Only then you can +1 things & recommend it to your friends or contacts. I hope you got the basic understanding of how the +1 button will work. If you’ve more doubts then kindly read my Introductory post of the Google +1 Button or visit the +1 Button’s Official FAQ page.
Now, let’s move onto the main thing i.e. to Add the Google +1 Button to your WordPress blog.

+1 Button
+1 Button Webmasters Page

Steps to Add the +1 Button to your WordPress posts

The process of adding the +1 Button to your post pages finishes within 6 – 7 baby steps as mentioned below.

  • Visit the Google +1 Button page.
  • Now, in the ‘Create a custom Button‘ section; select the button size you want and also the language from the dropdown.
  • Since we are adding the +1 Button in WordPress, you don’t need to fill the URL parameters located in the Advanced options. The reason for this is that, WordPress uses Canonical URLs and the +1 Button is functioned to get the URL of the page from the canonical field.
  • If you want the count to be displayed along side the +1 Button then Enable it.
  • Now, go to your theme’s Single page file i.e. Generally single.php. and paste this code
    <script type="text/javascript" src="http://apis.google.com/js/plusone.js"></script>
    just before the closing <body> tag.
  • You can also paste that code in the header.php file, but then it’s always good to include scripts at the footer section of your blog.
  • Now, paste this short code
    <g:plusone size="tall"></g:plusone>

    where you want the +1 Button to be displayed i.e. beside or above your posts.

Note:- I’ve chosen ‘tall’ as the size of the +1 Button, hence the parameter size is added to the short code. Similarly you can also add the parameter href for using a custom URL in the +1 Button.
Don’t wait further, just grab your +1 Button code after proper configuration and follow the above steps to add it in WordPress. Amidst the +1 Button, google launched a new service called Google Music which is currently limited to US users. I’ve made a HowTo post which will guide you to get the Google Music Invite outside US.
If you liked this HowTo post, then consider Subscribing to Our RSS Feeds / Daily Updates. Don’t forget to +1 this post as well.
So have you added the +1 Button to your WordPress posts ?

by