This blog post pertains to WordPress 3.1 and below. WordPress 3.2+ fully supports Authorship rel=”author”. However, if you’re using an older theme with WordPress 3.2, there is a slight chance your blog does not support Authorship.
What is Authorship?
Google supports the authorship markup. If you write content on websites, whether a blog post, video, or image gallery – you can tell Google that you’re the author of the content you’ve created. Let’s go into more detail:
An author page is a page about a specific person that writes articles, blogs, pictures, video, etc. A simple example: this site displays the author of each blog post. The posts that I write list my name (and other authors if needed). There is also a link on my name. It links to my “author” listing, where it lists all other blog posts I have written. The link jumps to http://ryan.sadwick.com/author/rsadwick/
As the illustration above points out, the author page links all of the posts created by that specific author. If your site is using rel=”author”, Google can use the author information to to identify the author of an article or page and determine the relevance of that page to a user’s query. To do this, you add rel=”author” to your link:
Note: As of now, author pages need to be on the same domain. This allows Google to tell the difference between content that could have been scraped verses the actual author’s posts. (This could change over time, like Canonical did).
Using rel=”me” on other sites.
Google also supports rel=”me” that allows the author to place a link to their website on different site that isn’t on the same domain. For example, let’s say I have a few profile websites that I may have written blog posts on, such as social networking sites. For example, the site is setup like so: http://example.com/authors/rsadwick On that and other sites, I could use the rel=”me” authorship:
The reciprocal rel=”me” links lets Google know the profiles at http://ryan.sadwick.com and http://example.com/authors/rsadwick are the same person.
Consider the illustration below:
How to add authorship on WordPress?
If you’re using a custom WordPress theme, it may or may not support Authorship. To check, you can use the Rich Snippets Testing Tool or look at your author link in the browser by viewing the source and check to see if rel=”author” exists.
If rel=”author” doesn’t exist, I’ll show you how to create a filter to override the WordPress method: the_author_posts_link
1. On your WordPress site, locate your functions.php. It should be located in your theme directory. If you do not have a functions.php, simply create one.
2. We want to override this WordPress method: the_author_posts_link function since we don’t want to edit it directly. If we did edit the WordPress core directly, we’d have to update it every single time WordPress updates. Let’s use add_filter instead!
So let’s create this method in the functions.php file:
4. add_filter simply inserted our override_author_posts_link instead of using the WordPress method the_author_posts_link, which did not have the rel=”author” attribute.
What Did We Do?
The the_author_posts_link method displays a link to all posts by an author. So, before our modification, the author link was rendering out the markup with the link and title to the author posts page… however, it wasn’t using the rel=”author” at all.
We simply added a filter in our theme’s functions.php. I copied the method from author-template.php to functions.php and renamed the method to override_author_posts_link and added the rel=”author” to be rendered in the markup.
Also, instead of calling the_author_posts_link, we apply the filter: override_author_posts_link is called instead and passes the $link that contains the modification we made.
So now when the_author_posts_link is called, our filter uses override_author_posts_link instead:
Most themes call the the_author_posts_link method when listing posts in WordPress. If you’re having trouble and need assistance, please contact me. I’ll be glad to assist you, however please be sure to give my tip jar some love.
Authorship helps with SEO.
In conclusion, using authorship creates relationship between a content page and an author page. This can aid your SEO efforts with all the websites you own.