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

Here's How To Hide Admin Panel Menus In Strapi

How to hide admin panel menus in Strapi. This is a quick guide to help you hide the admin panel menus in Strapi.

Read more

End-to-End Testing with Sanity Studio & Playwright

Learn how to do end-to-end test Sanity Studio with Playwright

Read more

Let's talk about your project