This is a guest post from Alex Moss. He is a Partner at Pleer, Head of SEO at Banc Media and develops WordPress plugins. He found a way to share to Google+ from an external site, similar to the tweet button, and wanted to share it with SoS readers…
Since Google+ launched, I have been asked a few times about whether there is some WordPress plugin or code to allow people to share a URL to Google+ from outside Google+ itself, in the same way a tweet, like or +1 button behaves. In short, there isn’t one. I don’t understand why this is, because as an SEO I’d want to make sure this was available immediately or at least used the +1 button somehow to add functionality to share the +1′d URL within Google+ for all/your circles to see.
At the moment there’s still nothing official available that will let you do this, however, I realised that I could use the share URL from the mobile site and manipulate it to behave how I want.
I modified the wide +1 button and changed the text to “share”. I made both the grey and blue versions of it below:
![]()
![]()
Here’s some sample code:
<a href="https://m.google.com/app/plus/x/?v=compose&content=INSERT_MESSAGE_HERE_WITH_URL_IF_YOU_WANT" onclick="window.open('https://m.google.com/app/plus/x/?v=compose&content=INSERT_MESSAGE_HERE_WITH_URL_IF_YOU_WANT','gplusshare','width=450,height=300,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;"><img src="http://path.to/plus.png" alt="Share on Google+" width="55" height="22" /></a>
The URL linked to contains the parameter content. This parameter will automatically generate as the post when the widow opens. I have also added 2 things into the <A> tag:
Here’s a working example of the button, sharing this article. Note that this will open a new window but will ignore the window.open() command:
WordPress is awesome, but you knew that already. WordPress here will be your friend by choosing all the 3 parameters automatically. I can edit the code slightly from Step 2 and I end up with this:
<a href="https://m.google.com/app/plus/x/?v=compose&content=<?php the_title(); ?> - <?php the_permalink(); ?>" onclick="window.open('https://m.google.com/app/plus/x/?v=compose&content=<?php the_title(); ?> - <?php the_permalink(); ?>','gplusshare','width=450,height=300,left='+(screen.availWidth/2-225)+',top='+(screen.availHeight/2-150)+'');return false;"><img src="http://path.to/plus.png" width="55" height="22" alt="Share <?php the_title(); ?> on Google+" title="Share <?php the_title(); ?> on Google+"></a>
NOTE: Insert this within your theme directly, not a post or page. For some reason I have noticed that WordPress removes the window.open command when inserted within a post/page.
There are 3 limitations to this:
The last point is a shame, but I guess if you really want the feature on your site it’s worth breaking one egg.
Have fun! I will be making a WordPress plugin for this soon enough…
Editors note: Alex was kind enough to implement this right away in our sharebar on the left, so you can start sharing the posts from State of Search to your Google Plus RIGHT NOW!
More posts about Google Plus
Great idea but a potential privacy hazard as clicking the button requires the following:
“By tapping ‘Accept’, you agree that Google will use your location in this product and accept the Mobile Terms of Service.”
You can add &hideloc=1 to the parameters which should stop this from being an issue.
Pretty cool… Thanks for sharing your share buttons!
[...] plugin or code allowing people to share a URL to Google+ from outside of Google+. “… …How to Share on Google+ from any websiteState of Searchall 2 news [...]
[...] plugin or code allowing people to share a URL to Google+ from outside of Google+. “… …How to Share on Google+ from any websiteState of Searchall 2 news [...]
[...] “…As an SEO I’d want to make sure this was available immediately or at least used the +1 button somehow to add functionality to share the +1′d URL within Google+ for all/your circles to see,” Moss wrote in a guest post on State of Search. [...]
Thanks! Will put it on my website. Would love it though if you could somehow program the familiar balloon with # times shared, above or aside the button. More coherent with the rest of my buttons
.
At the moment there’s no way of having a counter to illustrate the number of shares. However, it’s not impossible to create a counter for the number of times the button is clicked – not very accurate though!
Smart piece of code, thanks for sharing it!
[...] How to Share on Google+ from any website, State of Search [...]
Is there a Google+ share URL that can have a URL appended to its query string?…
Just found a workaround: stateofsearch.com/share-on-google-plus-any-website/ Though it only displays the mobile interface, it still works. [code]https://m.google.com/app/plus/x/?v=compose&content=[TEXT_TO_SHARE_HERE][/code]…
Requires my Google account password even though I’m logged into Google+ and Gmail in other tabs. Would like something that doesn’t require me to input my google account password because there’s no way I’d ask anyone to use this as it is.
Weird, all of my tests showed me as already logged in. What browser are you using?
Great tip!
I just shared your post on my Google+ account, and can already see a multitude of ways that it can be used within the online marketing space.
Would love to hear everyone’s thoughts on how we can start better utilizing Google+ for marketing. The share button is a step in the right direction, but i don’t think everyone has Alex’s mind to manipulate the code and create alternate functionalities.
http://www.GooglePlusForums.com has started listing tip and tricks, would love to get feedback.
[...] Bei stateofsearch gibt es neben zwei Share-Buttons auch entsprechende Codeschnipsel. Ich habe hier testweise mal zwei Varianten mit folgendem Code eingebunden, welche funktionstüchtig sind: [...]
thanx, for that. will use it with js integration in wordpress.
http://www.aboutgplus.de/2011/08/10/google-share-button-selbst-gebaut/
[...] code voor de share-button is terug te vinden op de StateofSearch blog. Mensen die niet zo handig zijn met code moeten nog even afwachten. Alex Moss is namelijk een [...]
[...] knop om direct je website of content op Google+ te delen. Hier bedacht Alex Moss wat op en schreef op StateOfSearch over hoe je een zelfgemaakte “Deel op Google+” knop op je site kunt [...]
[...] Quelle [...]
[...] ovu novu značajku na vašu web stranicu ili da bi je dodali na WordPress teme, možete pronaći ovdje. Relevantni naslovi:Novi Google +1 gumb od danas dostupan za implementiranje na web [...]
[...] Moss hat eine simple Möglichkeit aufgezeigt, mittels eines simplen Buttons (oder Links) Beiträge aus jeder beliebigen WebSite heraus bei [...]
[...] normale Webseiten, die für ihre Webseite keine WordPress Software benutzen, gibt es hier bei StateOfSearch. Scheinbar lässt sich der Share Button bislang nicht in einzelnen WordPress Posts, sondern nur [...]
WHY IS ALL THE CODE IN CAPS?
How do I install this into my sharebar?
I tried entering the code but it doesn’t work.
[...] to their main Google+ timeline from outside of it. Alex Moss has been kind enough to provide a comprehensive guide on how to implement such a feature for WordPress (or other types of) websites. As you probably can tell, we are using Sharebar for WordPress to [...]
CAPS OFF ?!? Why is all the HTML caps locked ?
The caps is the font in the template, I fixed that now, but we are looking at what is a better solution.
[...] (Источник) Похожие записи:Gmail-тема в стиле Google+Виджет G+ для сайта2 темы оформления в стиле Google+ для Windows 7Скрипты с эффектами из галереи и кругов Google+ (jQuery, CSS) window.___gcfg = {lang: 'ru'}; (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); The Google+ Song (видео) → // [...]
[...] (src) [...]
[...] Moss, the Head of SEO at Banc Media and a WordPress plugin developer, has come up with a temporary solution to get a Google+ share button on to your posts, by adding the code directly into your WordPress [...]
[...] Moss, the Head of SEO at Banc Media and a WordPress plugin developer, has come up with a temporary solution to get a Google+ share button on to your posts, by adding the code directly into your WordPress [...]
[...] Moss, the Head of SEO at Banc Media and a WordPress plugin developer, has come up with a temporary solution to get a Google+ share button on to your posts, by adding the code directly into your WordPress [...]
[...] dann habe ich hier noch eine Seite gefunden, die einen Share Button gebastelt hat. Habs noch nicht ausprobiert, [...]
[...] a WordPress plugin developer, has come up with a temporary solution to get a Google+ share button on to [...]
[...] Moss, the Head of SEO at Banc Media and a WordPress plugin developer, has come up with a temporary solution to get a Google+ share button on to your posts, by adding the code directly into your WordPress [...]
[...] interesuje, detaljno uputstvo za implementaciju dugmeta možete pogledati ovde. Blog this! Bookmark on Delicious Digg this post Recommend on Facebook Share on Linkedin share via [...]
[...] How to Share on Google+ from any website – State of Search Kommentare: 0 Tweets: 0 Facebook-Likes: 0 15.08.2011 Ads_BA_AD('FOOT'); Das könnte dich auch interessieren:t3n-LinktippsTumblr überholt WordPress, CIA-Website gehackt, Chromebooks Verkaufsstart, Facebooks Foto-Sharing AppDiesmal bei unseren Fundstücken aus dem Netz: Tumblr überholt WordPress, Hackergruppe legt CIA-Website lahm,…t3n-LinktippsCSS3 animiert, SEO mit Google Docs, Sliding Content, Twitter Tools, Facebook stagniertDiesmal bei unseren Fundstücken aus dem Netz: eine Einführung in CSS3 Keyframe Animationen, Social Media Links mit…TechnikLOAD 44 – WordPress 3.2, Facebook-Videochat, Crowdfunding, OS X Lion und das GewinnspielWordPress 3.2 ist erschienen und überrascht uns mit einem Kiosk-Mode und der Schriftart Arial.Google +1 schlägt Twitters Tweet-Button innerhalb eines MonatsGoogle +1 Social Buttons legen einen sagenhaften Start hin. Obwohl sie erst seit etwas mehr als einem Monat verfügbar… Weitere Artikel zu Facebook, Google, Google+, Social Networks und WordPress [...]
great, well done Alex. You are right though, the box isn’t pretty or easy to figure out, it doesn’t feel like it’s “legit” if you know what I mean. But it’s very cool and a good start.
[...] aber die Erklärung wie’s geht habe sogar ich verstanden. Alex Moss erklärte damals auf State of Search, wie es zur Überbrückung geht. Hier aber der link zum Plugin und Erläuterung: (klick auf [...]
[...] erfordert die Einbindung des Buttons etwas handwerkliches Geschick. Mit der Anleitung dürfte es aber funktionieren. Trotzdem eine praktische Sache finden wir. Daher haben wir ihn auch [...]
[...] New! How To Share Google+ URLs From A Website: A hack to enable G+ [...]
[...] le titre en anglais du lien «How to Share on Google+ from any website – Google – State of Search» que je traduis [...]
[...] How to Share on Google+ from any website – State of Search – Alex Moss of Pleer has developed a workaround solution for a Google+ sharing button. You can add it to your site for your visitors to share directly on Google+, in contrast to +1 votes that show up in an extra tab. [...]
[...] How to Share on Google+ from any website – State of Search – Alex Moss of Pleer has developed a workaround solution for a Google+ sharing button. You can add it to your site for your visitors to share directly on Google+, in contrast to +1 votes that show up in an extra tab. [...]
[...] говоря, не очень. Но выбора как бы нет, так что говорим автору кнопки [...]
hello,
very good code !
but, how to share thumbnail ?
Thank’s
Is there a URL this will work with that isn’t for mobile?
Exactly what I was looking for Andy!
This uses the mobile version of google plus. Is there something equivalent for the desktop version? I’m trying to implement an html only (no script) version of the +1 button.
Unfortunately this is the only way, and has to use the mobile site as Google+ haven’t offered a desktop version of it. Google+ have mentioned that you can share on Google+ once you +1 the URL – but I’m yet to see that for myself
Thanks to your code I was able to craft a nice custom working share button. Thanks so much!
care to share the URL?
This one is quite neat:
http://ajbatac.com/gplus-bookmarklet.php
NICE job man
, i’m going to use it not on wordpress site but on my personnal rss reader 
THX a lot !!
It prompts me to accept the Mobile Terms of Service, and when I click “Accept” it simply refreshes the message. Can’t get past it.
Same as Sam said. Can’t get past the Accept button. Any workaround?
The code can now be updated. I have made this into a WordPress plugin now:
http://pleer.co.uk/wordpress/plugins/google-plus-share-button/
Is there a URL this will work with that isn’t for mobile?
[...] what do people share…? Links! And they share many. Surprisingly enough Plus is already the second largest referral to State of [...]
Thank you for your work on this Alex.
Unfortunately I can not get it work. I have tried to add &hideloc=1 to the parameters as you suggested and I think I am not doing it right. Can you provide a code snippet as an example? I would love to implement on my site ASAP.
[...] trước chỉ có thể share qua link mobile, giờ có thêm 1 cách trực tiếp [...]
Getting ‘An error occurred. Please try again.’ message. When I try to share. The error also occurs on the share button on this website. Anyone have any thoughts. I’m using a User Agent switcher set to iPhone.
Yo can share using the +1 button. Once you clicked on it wait and click on ‘share on Google+’
Getting ‘An error occurred. Please try again.’ message. When I try to share. The error also occurs on the share button on this website.
I have since developed a WordPress plugin for this:
http://pleer.co.uk/wordpress/plugins/google-plus-share-button/
[...] Bookmarklet Google+ dari Aj Batac Tombol Custom Google+dari Alex Moss [...]
[...] experts on G+ points out that this was possibly by a hack using the mobile client as described here http://www.stateofsearch.com/share-on-google-plus-any-website/ Check the comments below. Remember you still have click the post button yourself so it´s no [...]
You mentioned there’s a way to ‘share’ to the general public using this method. Is there a way to code it so that the public option is selected by default to anyone who clicks?
Getting ‘An error occurred. Please try again.’ message. When I try to share. Plese help me out that why Am I getting this error.
Using the below code to share content on google plus. Plese tell me where am I doing wrong:
<a href='https://m.google.com/app/plus/x/?v=compose&content=‘
onclick=”window.open(‘https://m.google.com/app/plus/x/?v=compose&content=','gplusshare','width=450,height=300,left='+(screen.availWidth/2-
225)+’,top=’+(screen.availHeight/2-150)+”);return false;”>
[...] you’re offering people. There is currently no official ‘Share on Google+’ button (though unofficial ones have been hacked), but this could prove a valuable tool. Even before brands are formally allowed on Google+, the [...]