

GOOGLE RICH SNIPPETS TESTING TOOL CODE
You’ll either have to figure out the original theme’s code and edit it, or refer to the details for specific themes below.We’re going to add the following (and modify it as it explains).If they are we will just add the extra dateUpdated itemprop but if they are different we will output some extra text to the visitor We are going to check if the published and updated dates are the same.You can search through your theme files, or refer to theme specific details below where I have provided details for lots of themes This will almost certainly use the wordpress function get_the_date(). We need to find the file that contains the code which generates the published link.We will need to do this for posts, pages, archives and the homepage. We’re going to add some additional information to post headers, both for search engines and for our visitors. We’re also going to change from microformats to microdata at the same time. I recommend the proper way of course, but if necessary you can resort to the quick hack. This is a pity, because updated is required whereas published actually isn’t! Adding it is easy though, and again, there are 2 ways, the proper way and the quick hack way. Most wordpress themes include information about when the post was published in the post information area, but very few also include when it was last updated. This code will use the post author’s google profile url if there is a valid one, and will use a default (yours) if there isn’t. Don’t forget to change my google profile url to yours. If you’re insistent about not using the Yoast plugin you will need to manually add the following code to header.php (assuming you have one).Now, if you’re using the Yoast plugin, go to the SEO menu and select Titles and Metas, click on the Home menu at the top of the page and in the Author highlighting pulldown box select the user you want to use as the author of the homepage.Make sure either you, or your other site authors do the same thing, and each link to your own google profiles.In the Google+ field add a link to your google profile (e.g.

GOOGLE RICH SNIPPETS TESTING TOOL INSTALL
Install the Yoast SEO plugin OR add the following code to the functions.php file of your themeĪdd_filter ( ‘user_contactmethods’, ‘update_contactmethods’, 10, 1 ).There are 2 alternative ways to do this, I highly recommend using the Yoast SEO plugin. Now we need to add a link from your author page to your google profile. )Īdd a link from your site to your google profile Make sure the box to the right of the text contributor to is set to public.Under the contributor to section click Add custom link.Scroll down until you see the links section somewhere towards the bottom right of the page.Ideally you will need all of your authors to have a google profile that is linked to your site in the same way as this. You will see on my google+ profile that I have a public link to - you will need the same for your own site. So lets get started… Add a link from your google profile to your site Once you’ve managed that you should find adding extra markup is relatively easy. I’m not going to cover all the optional extras in this article, just the basics to get your site to validate with the tool. It also makes more sense as several of the steps are the same regardless of what theme you are using. This makes it easier to keep up to date, and means there is just 1 central point for all requests and discussion. Instead of having lots of separate articles for different themes I’ve decided to try to provide all the information in 1 guide.
