Google Author Link – Adding to a Older WordPress Blog

By On 22, Aug, 2011 |  In: SEO, Website Development | Tags: , , , , , , , , , , , , , , , , , , , , , ,  | 0

While trying to add “Google Author” to our website, I did a search to see what other people were doing and maybe find some info about how other people were doing it. After looking at what a few people had done, I found that the solutions that were there dealt with a single person blog or adding a “Link” to each post that links back to the “Author” page on the site ( which has the “Link” to the person “Google Plus One” profile page ).

So I started thinking about it, and I really didn’t want to go back and add a link to the proper “Author” page to each post ( there are over 600 posts ), and to have a “Link” in the main menu to each “Author” page would not help with having the post connected to the right “Author”. I thought and thought and I finally came up with what I consider a solution. You see, “WordPress” has many functions that are either not used or use rarely.

“get_the_author()” is used to show the “Author” of the Post and add a link to the “Author Archive” of their posts. But it also returns the “Author’s” name that you have given it, so if you take that info and use it in an “IF” statement you can do many things with it. So I took it and made it “Echo” back a link to the proper page with the rel=”author” in it. Editing the “single.php” file in the “Theme” adding code to where the “Author” was called.

Here is an example :


             if(get_the_author() == “Some Guy”){

                        echo “<a href=’’ rel=’author’>Some Guy</a>”;


              elseif(get_the_author() == “Some Other Guy”){

                          echo “<a href=’’ rel=’author’>Some Other Guy</a>”;



              echo “<a href='” . get_author_posts_url( get_the_author_meta( ‘ID’ ) ) . ” ‘>” . get_the_author() . “</a>”;



The first 2 “IFs” show different links one for each “Author” and the last “Else” show the “Wordpress” link to the archive for an “Author” with out a “Google Plus One” page.

After doing this I tested it with the “Rich Snippets Testing Tool” and found that the Post really did link to the “Author” page and then on to the “Google Profile”. With this I save hours of work and made it so that future Post will have the link in it too.

I know this may be difficult for some people who aren’t familiar with “Web Design” ( you need to be comfortable editing your theme files ) , but if you have an older blog with more then 1 Author you could be awhile adding a link to each Post.

Leave a Reply

Your email address will not be published. Required fields are marked *