How to add Google’s +1 to a WordPress Blog

How to add Google’s +1 to a WordPress Blog

Both Google and Bing admit that websites and blog content that is shared on social media networks have a greater chance of ranking in organic search results (the main search results, excluding sponsored – i.e. paid for – results). In fact, according to an article on Wired.com, Google is embarrassed that they didn’t jump on the social bandwagon much earlier.

Google are now starting to combat this with the introduction of ‘Google +1’ (plus one), although presently there’s a great deal of discussion as to whether a +1 for your blog post will rank your post higher in search results.

At this stage, it would appear that, yes, it would rank higher but only to those that have a Google account and are connected to someone who has given your post a plus one. In reality for New Zealand, this might be quite a small share of the market.

Not only do you require a Google account to give a search result a plus one, you also need a Google Profile. Try without a Google Profile on a Google Apps account and you receive this message:

Oops… you need a Google profile to use this feature.

Google Profiles is not available for your organization.

For those Internet users to which it applies, the +1 service is designed to help searchers find content that is more relevant to them, based on their past likes and the likes of those in their network.

It’s similar in many ways to Facebook Likes. In fact, I’ve already used the term ‘likes’ in this paragraph but that’s because it’s quite difficult to say ‘based on their past plussed ones’. You can find out more about how the system works on Google’s own +1 page.

Google Plus One in Search Results

In Google’s words:

The +1 button is shorthand for “this is pretty cool” or “you should check this out.”

Click +1 to publicly give something your stamp of approval. Your +1’s can help friends, contacts, and others on the web find the best stuff when they search.

At time of writing, the +1 button appears right next to a search result, but only when you are signed into your Google account and only on Google.com for an English language search. It looks like this:

Google Plus 1 in Search Results

Clicking on a +1 (remember you’ll need a Google account as well as a Google Profile) turns it blue and adds a message next to the search result to show that you have publicly +1’d it.

Searching again for the same term and a small icon from my Google Profile appears next to this message. I assume that if I find a search result that someone in my network has given a plus one, their own icon will appear next to this result. Google believes this familiar face and name will encourage me to visit the same website as it has effectively been endorsed by someone that I know.

In terms of your blog, in time this +1 icon will appear next to all search results so there’s nothing you need to go to add this to your site, unless you wish to have your own +1 button that shows on your website, as described next.

Google Plus One on your Blog

First off, why would you want to add Google’s +1 button to your blog? Particularly as it may not yet have a direct affect on search results for the majority of New Zealand Internet users (I’m speculating there – don’t go quoting stats at me!). Well, there’s a few reasons that you may choose to do this:

  • It’s cool. Showing that you’re connected to social media and you’re up to date with Facebook Likes, Twitter shares and now Google’s +1 shows that you’re a modern blog writer who is in touch with social media. And in the Internet world, that’s cool.
  • It’s relatively easy. Simply place some code in two different files on your WordPress blog and it’s done (I’ll show you how to do that next).
  • It’s free attention. Once you’ve added the code to your site, you can sit back and let others spread the word about your work. Making this as easy as possible for your visitors is a good factor in getting your content noticed.
  • It may mean a lot more in the future. Right now there may not be much of an advantage to have a +1 button on your blog post but there’s a good chance that Google will use this data to affect organic search results across the board at a later date. Originally Google didn’t care about how many Facebook Likes our Twitter shares a web page did but now they admit to using it to affect search results, particularly to find new content that is on a suddenly trending topic.

All of this adds up to the conclusion that it’s probably worth giving it a go. And with sharing on social networks becoming more and more common, it’s now almost expected that a blog post has some form of sharing button so that a reader can easily tell their network about your content or show their appreciation for a well written post.

Adding Google’s Plus One Button to your WordPress Blog

Generally, there are two styles of plus one button. One that gives a recommendation to the page on which it is displayed, another that gives a recommendation to a specific website address that you set.

In this fashion, it’s possible to have two plus one buttons on the same page that work independently of each other.

To set up a basic Google plus one button that appears at the end of your WordPress blog (one that you have installed rather than a WordPress.com blog) you can use this fairly simple process.

Note that editing these files can screw up your blog something chronic if you get it wrong. Copy the text in the file you’re about to edit and paste it into a Notepad txt file so that if you break something, you can restore the text from the Notepad file.

Here’s the files you need to edit:

1. Edit your Header File (header.php)

This is much easier than it might first appear. There’s no special editing software required and you don’t need a degree in web language programming stuff.

Just do the following:

Go to your WordPress dashboard and then click on the Editor menu item under the Appearance heading:

Edit WordPress Header File

Next click on the ‘header.php’ link that appears on the far right. This should open the header.php file for editing in the main central window.

Now you’ll need to copy some code into your header.php file, after the ‘head’ tag. Nothing too complicated. The code that you need to copy is shown in the screenshot below (and can be copied from Google’s page here)

Google +1 Code

… and this shows where you need to paste it:

Paste Plus 1 Code in Header File

Note that your header file might look a bit different to this. For one, it probably won’t have ‘Typebased’ at the top. It’ll have the name of your theme instead. The key thing is to simply make sure you paste the line of code after the ‘head’ tag. Just make sure you don’t over-write any of the existing code.

Once you’re done, click ‘Update File’.

This file basically tells every page on your blog what to display at the top. In this case, the page tells the browser to run a script that prepares your page to display the Google +1 button. However, you still need to tell your blog post where to display the button.

To do that, there’s just one more file to update …

2. Edit your Single Post File (single.php)

There’s a chance that this file name may vary depending on the theme that you use for your WordPress blog, but hopefully it will be called something similar to this.

By using the guidelines above, go to the Editor menu item under Appearance again but this time click on the ‘single.php’ file. This will open the file for editing in the main text window.

Inside the file, you’ll need to find the tag that looks like this:

<?php the_content(”); ?>

This tells the browser to display your blog post. Immediately after this is what appears below your blog post, so add a line immediately after this tag and paste the following code into your file:

<g:plusone></g:plusone>

Once you’ve done this, hit ‘Update File’. Now just to one of your live blog posts and refresh the screen. You should be able to see the +1 button at the bottom of your post and before your comments.

Note that you can change some of the attributes of the button. If you already have Facebook Likes and Twitter buttons at the end of your post, you’ll noticed that the default +1 button is bigger. Clever marketing, that! To make it the same size as the Like and Tweet buttons, you can change the code to this:

<g:plusone size=”medium”></g:plusone>

You can find more variations on the size and view previews on the official Google +1 page.

Any questions? Leave a comment below and we’ll respond with assistance.

While you’re at it, why not give this post a +1? ;)

  • Shinenelle Belle

    I didnt manage to find the second code

  • Hi Shinenelle, it’s possible that your single post file looks different to the one we used. That’ll be because you’re using a different theme. You basically need to find something in that single.php file that could mean that it is displaying the content of your blog post.

    It will probably be followed by something that mentions the comments (think of the code in that file as displaying what you see on the final page from top to bottom, so a title first, then the content, then the comments, then the footer).

    You need to post that second code between the post content and the comments. 

    If you’re still having trouble, maybe let us know what design theme or template you are using and we’ll see if we can figure out how that code is different.

  • Pingback: Add Social Media Buttons to a WordPress Blog | Blog Guides()

  • Bec

    In my appearance menu it doesnt have the option of ‘editor’ or even ‘plugins’. Why is this? Neeeed help!

  • Hi Bec, that one could be because your WordPress user account doesn’t have the rights to access the Editor. Was your blog set up by someone else like a Website Designer or Developer?