How to Establish Authorship For Your Posts In WordPress

Yesterday, I show you how you can establish authorship for your site/content so that your Google profile picture will appear beneath the search results. However, in WordPress, it may not be as easy as it seems. WordPress is using a template system to display your content, so adding the rel=”author” tag will require some tweaking of the theme.

Here’s how you can establish authorship in WordPress.

Note: The following solution is just one of the many ways to establish the authorship of your content. If you have a better, easier way, feel free to use it.

1. Make sure you have an About page that describes who you are and what your blog is about. At the end of the content (of the About page), insert the following link:

<a href="http://your-google-profile-url" rel="me">Follow me on Google +</a>

Remember to replace the http://your-google-profile-url with your Google Profile URL.

Note: The Google Profile URL is of the format: https://plus.google.com/1234567890987654321.

Next, go to the theme editor and open your functions.php file. Insert the following code at the end of the file:

add_filter('the_content', 'add_author_link');
function add_author_link($content)
{	if(is_single())    	
		$content .= '<p>This article is written by <a href="http://link-to-your-about-page" rel="author">'.get_the_author_meta('display_name').'</a></p>';
 
	return $content;	
}

Save the changes.

What the above code does is to insert a sentence at the end of your article with a link to your About page.

1. Get all your authors to update the Jabber/Google Talk field in the Profile section with their Google Profile URL.

2. Open the functions.php file and insert the following code:

add_filter('the_content', 'add_author_link');
function add_author_link($content)
{	if(is_single())    	
	{	$content .= '<p>Follow this author at <a href="'.get_the_author_meta('jabber').'" rel="author">Google+</a></p>';
	}
	return $content;	
}

The above code will grab the Google Profile URL from the author’s Jabber/Gtalk field and insert the link to the end of the content.

That’s it.

It will take 1-2 weeks for Google to show your profile picture in the search results. Meanwhile you can use the Rich Snippet Test Tool to see how your page looks like in the search results.

Do you like what you read here?

Receive the latest update in your inbox.

Or connect with us: