Add Google authorship markup to WordPress sites using All in One SEO Pack
I’ve read up on Google authorship markup this week, particularly in the context of adding it to websites built on WordPress.
For Google, the idea is to surface web content by popular authors in search results. For writers – or indeed anyone publishing online – it can help you assert ownership over your web content and enhance your personal brand online. (Urgh, I sound like a snake oil marcomms consultant; it’s true though.)
Google shows the author’s avatar and extra detail in search results, which help the author’s content stand out. For example:
Authorship markup semantically describes the relationship between a piece of content and its author, so search engines can identify the author’s work published on multiple sites. In practice, this means explicitly linking your Google+ profile to your content using
Connect your sites to your Google+ profile
The first thing to do is add the sites you write for to your Google+ profile.
- Go to your profile in Google+, select the About tab, scroll down to the Links box and select Edit.
- Go the Contributor to section and select Add custom link.
- Add your website name and URL:
Add authorship markup to a single-author WordPress site
After reading lengthy guides by Rick DeJarnette and Tara Horner, adding authorship markup seemed overly complex. For WordPress themes, Tara explains editing the post and author page templates to include
rel="author" on the post author name anchor, and linking the author’s name to their Google+ profile.
This doesn’t suit my purposes.
Firstly, I’m the only person writing on this site. In that respect this is a ‘single-author WordPress blog’ and it’s obvious to readers I write all the posts. To change the post metadata to include my name, and link it to my Google+ profile, just so I can add
rel="author" seems daft. That would mean changing the post metadata from:
Carefully posted on 15th December 2012
Carefully posted on 15th December 2012 by <a href="https://plus.google.com/u/1/109382002866848246485/" rel="author">Gavin Wray</a>
(For multi-author WordPress blogs, changing the post metadata in this way would break WordPress’ established navigation to view all posts by an author by clicking the author’s name.)
After digging around my site, I stumbled on a neat solution using the All in One SEO Pack plugin.
- Go to your WordPress dashboard menu and select All in One SEO.
- Scroll down to the text field labelled Google Plus Default Profile and enter your Google+ profile url. If you don’t know your url, go to Google+, right-click on your Profile icon and copy the link address. It looks like
- Scroll to the bottom of the All in One SEO settings and select Update Options.
Now visit any page on your site and view the source html. Notice the following line in the
<link href="https://plus.google.com/u/1/yourprofileid123" rel="author" />
This line tells search engines that the page was written by the person who owns the Google+ profile at the specified url.
Verify authorship is working
Now it’s time to test the authorship is working using Google’s structured data testing tool.
- Copy any url of a page on your site.
- Paste this in the url field of the Google structured data testing tool. You should see a preview of how your page will appear in search results with your avatar, links to more of your content and verified authorship:
Add authorship markup to a multi-author WordPress site
If your WordPress site has multiple contributors and you use the All in One SEO Pack, the process to add authorship markup is slightly different:
- In your WordPress dashboard menu, select All in One SEO.
- Scroll down to the text field labelled Google Plus Default Profile and ensure the field is empty.
- Go to Users > Your Profile and scroll down to the field labelled Google+ under Contact Info.
- Enter your Google+ profile url and save your changes.
- Visit any post or page which you published on the site, view the source html and you should see the markup in the
<link href="https://plus.google.com/u/1/109382002866848246485" rel="author" />
Hopefully, that’s simpler than editing your WordPress theme.