WP Parabola Theme and Google Structured Data

While setting up my Google Webmaster Tools I ran into the problem that WordPress in combination with the nice Parabola Theme is not 100% conformed the Google expectations. I saw some errors on the page and tried to figure out what exactly triggers this error. On the overview page I found these entries.

google webmaster tools failure

 

The crawler of Google searches for the hatom information on the page. For my page it finds most of the tags, like the author, the title, the content and also the publish date. But it searches also specific for the field “updated”. The failure occures more often on category sites, because there are more entries, and only once on the simple post.

After some research I found a solution by adding  some simple lines to some files in the theme. But because you still want to update your theme, the best way to edit your theme is by adding a child to the normal theme. This is basically done by creating a new folder under /wp-content/themes/ with the name %theme-name%-child. In my case this was “parabola-child”. After creating a child folder, a file named sytle.css has to be created in the folder. The basic setup is in my case:

 The most important line is  Template: parabola. This tells WordPress that this is a child of the Parabola theme. All steps can be found here. WordPress will now load all files from the child folder and override the corresponding files of the main theme. Basically you can copy a file like header.php to the child theme and edit it. The rest of the files will be loaded from the main theme. In our case I searched the content.php and found a link to the parabola_posted_on() in includes/theme-loop.php function. This function provides the meta information of the post and can also be used to write the additional tags to the page. Unfortunately, after i copied and edited my file, WordPress was still loading the main file. This seems to be a bug or i did simply something wrong, ten times or so… Anyway, I decided to change in this case the content.php file. I copied the  snipped from here and added the “hidden=true” to prevent that information from rendering to the screen.

After this modification, the category pages will have the hidden information and Google will crawl these pages without errors. But the single post will still have this failure. So again, after some searching, I figured out that this is related to the file single.php. So I added the same two lines there.

 google_webmaster_tools_failure_detailIt seems that the theme also deliverers wrong data to the crawler when showing single posts. In the picture on the side,it is visible that it writes for the bookmark the date and not the name of the post. But i was fine with the result until now. Maybe i’ll fix this later or write a bug report to the programmer.

Bookmark the permalink.

Leave a Reply

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