Adding Google Authorship Into Your WordPress Site

  • google
  • google authorship
  • seo
  • wordpress

Based from Craig Fifield's article on How-To Add Google Authorship To WordPress Correctly I was able to put a better way (hopefully) of doing the said thing.

The catch here is not to waste your time downloading plugins for you to easily integrate the Google Authorship recently from Google.

Here's how you do it in as easy as 1, 2, 3…

1.) Open your theme's functions.php file. If you're using a child theme, use that one (definitely better).

2.) Add the following code below:

// Google Authorship Integration
if (!function_exists('google_authorship')) {
  function google_authorship()
  {
    if (is_single() || is_page()) {
      echo '<link rel="author" href="YOUR-GOOGLE-PLUS-PROFILE-LINK" />';
    }
  }
}
add_action('wp_head', 'google_authorship');

3.) Replace “YOUR-GOOGLE-PLUS-PROFILE-LINK” with your Google+ profile. Save/Upload it and test using Webmaster Structured Data Testing Tool

Edit: Added safeguard to function and some minor corrections.

More articles

Why AI Makes Us Lazy (And How to Fight It)

The framework is simple. Following it is hard. Not because it's complicated — because we're human. Here are the temptations, the warning signs, and how to build the discipline.

Read more

The Responsible AI Development Framework

Six phases for workflow. Five practices for thinking. A systematic approach to using AI that amplifies your judgment instead of replacing it.

Read more

Let's talk about your project

Ready to bring your ideas to life? Whether you need a consultation, want to discuss a project, or just want to say hello.