mrtsherman
mrtsherman

Reputation: 39872

HTML5 valid Google+ Button - Bad value publisher for attribute rel

I recently migrated my website from xhtml transitional to html5. Specifically so that I could make use of valid block level anchor tags. <a><div /></a>.

When running validation I encountered the following error:

Bad value publisher for attribute rel on element link: Keyword publisher is not registered.

But according to this page, that is exactly what I am supposed to do.

https://developers.google.com/+/plugins/badge/#connect

My code:

<link href="https://plus.google.com/xxxxxxxxxxxxxxxx" rel="publisher" />

<a href="https://plus.google.com/xxxxxxxxxxxxxxx?prsrc=3" style="text-decoration:none;">
  <img src="https://ssl.gstatic.com/images/icons/gplus-16.png" alt="" style="border:0;width:16px;height:16px;"/>
</a>

I can't figure out how to implement this in an html5 compliant way. Can anyone help?

Upvotes: 6

Views: 2997

Answers (3)

don magug
don magug

Reputation: 322

Well, you must add two links inside head tag and body tag as follows:

<head>
  <link href='https://plus.google.com/xxxxxxxxxxxxxxxxx' itemprop='publisher'/>
</head>

After that, use the the google+ format in the body. It should be below body tag:

<body>
<a href="https://plus.google.com/xxxxxxxxxxxxxxxxx" rel="publisher" />
.....
.....
.....
</body>

here's the screenshot. Oops! sorry, I need 10 reputation to load Image in this page ... LOL From the two formats, we will be validated by Structured Data of Google Webmaster and validator.w3.org. As you know that in microdata schema uses publisher as one of the itemprop, therefore, in body tag or in html tag should be like this:

<body itemscope="" itemtype="http://schema.org/Blog">

*) that's it when your site type is a BLOG.

(Love this forum) tina-andrew-blog NB: I found this: https://productforums.google.com/d/msg/webmasters/lciIK8HdJXE/kcv8EipRzzcJ But, I do with the code above, It works well :(

Upvotes: 0

Oliver
Oliver

Reputation: 9488

Google sends help: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=2539557&topic=2371375&ctx=topic.

You need to add ?rel=author to your <a>s href value and delete that non-conformant <link> tag:

<a href="https://plus.google.com/12345?rel=author">
  <img src="https://ssl.gstatic.com/images/icons/gplus-16.png"/>
</a>

Upvotes: 0

Omar Juvera
Omar Juvera

Reputation: 12287

1st) Within <head>:

<!DOCTYPE html>
<head>
    <!--head code-->
    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</head>

2nd) Anywhere within <body>:

<body>
    <!--body code-->
    <div class="g-plusone" data-size="small" data-annotation="none" data-href="https://plus.google.com/u/1/+StackExchange/"></div>
</body>



This code is valid AND "FRIEND'S" with http://validator.w3.org/

You can change https://plus.google.com/u/1/+StackExchange/ for any google+ url you desire (https://plus.google.com/xxxxxxxxxxxxxxxx/)

Documentation

Upvotes: 3

Related Questions