Title: Structured Data Testing Error
Last modified: August 31, 2016

---

# Structured Data Testing Error

 *  Resolved [overkill22](https://wordpress.org/support/users/overkill22/)
 * (@overkill22)
 * [10 years ago](https://wordpress.org/support/topic/structured-data-testing-error/)
 * Hi guys,
    I’m trying to figure out what happened as I had errors in all my website
   that I assume could be addressed to this plugin. I found in my header this code`
   <head <?php do_action( 'add_head_attributes' ); ?>>` that was causing problems.
   Now I changed to:
 *     ```
       <head>
       <html <?php do_action( 'add_head_attributes' ); ?>>
       <meta charset="<?php bloginfo( 'charset' ); ?>" />
       <meta name="theme-color" content="#47403f" />
       ```
   
 * 1. Is the code correct now?
 * [https://wordpress.org/plugins/wpsso/](https://wordpress.org/plugins/wpsso/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [10 years ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376386)
 * No, not at all. A typical header.php file would include the following (as an 
   example):
 *     ```
       <!DOCTYPE html>
       <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" <?php language_attributes(); ?>>
       <head <?php do_action( 'add_head_attributes' ); ?>>
       <meta charset="<?php bloginfo( 'charset' ); ?>" />
       ```
   
 * The “add_head_attributes” action defined a Schema type for the <head> section
   only, to avoid possible conflicts with the theme. I would suggest to restore 
   your header.php and then we can look at those errors. 😉 After you’ve restored
   your header.php, provide a URL to an example post/page with errors, and describe
   the issue on that specific page (so we know what to look for). 😉
 * js.
 *  Thread Starter [overkill22](https://wordpress.org/support/users/overkill22/)
 * (@overkill22)
 * [10 years ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376475)
 * I looked at the original header.php of my theme and I couldn’t find `<head <?
   php do_action( 'add_head_attributes' ); ?>>` anywhere.
 * I had multiple errors all over the site due to an external issue (LinkedIn) that
   lead me to notice this code in the header. So I had different errors at the same
   time, but they were not related–I didn’t know at that time.
 * Searching with Google for that code lead me to your plugin.
    Here the first three
   results:
    1. [link one
    2. [link two](https://wordpress.org/support/topic/duplicate-errors-and-warnings-after-update?replies=3)
    3. [link three](https://wordpress.org/support/topic/not-showing-correct-images-on-facebook?replies=4)
 * since I didn’t find any solutions for my problem I opened a new topic here.
 * At the moment I don’t have any more errors except the warnings
 *     ```
       WPSSO Notice	Possible conflict detected — your theme or another plugin is adding a link rel="author" HTML tag to the head section of this webpage.
       WPSSO Notice	Possible conflict detected — your theme or another plugin is adding a meta itemprop="description" HTML tag to the head section of this webpage.
       ```
   
 * Could this be because I have the All in One SEO Pack plugin installed?
 * The other question is, what was the reason why `<head <?php do_action( 'add_head_attributes');?
   >>` was in the header.php? I can’t remember adding it at all.
 * [Here](https://clicksforcakes.com/be-inspired-interview-with-lulu-goh-from-sweet-endings)‘
   s a link to a page of my website.
 * Thanks for your time
 *  Thread Starter [overkill22](https://wordpress.org/support/users/overkill22/)
 * (@overkill22)
 * [10 years ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376505)
 * I’ve contacted my theme developer and they said that it is ok to have the line`
   <?php do_action( 'add_head_attributes' ); ?>`.
 * However, after adding it in the right place as suggested by the theme developer
   `
   <html <?php language_attributes(); ?> <?php do_action( 'add_head_attributes' );?
   >>`
 * I still get 7 errors on the page.
 * Errors are under ARTICLE:
 *     ```
       author  A value for the author field is required.
       datePublished  A value for the datePublished field is required.
       headline  A value for the headline field is required.
       name  A value for the name field is required.
       publisher  A value for the publisher field is required.
       dateModified  The dateModified field is recommended. Please provide a value if available.
       mainEntityOfPage  The mainEntityOfPage field is recommended. Please provide a value if available.
       ```
   
 * HTML
 *     ```
       <html lang="en-US" prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# article: http://ogp.me/ns/article#" itemscope itemtype="http://schema.org/Article">
       ```
   
 * EDIT:
    team developer said that in the theme the markup for Article Type is NOT
   added, so that’s why the error. If from your side everything is fine, I think
   the post is resolved.
 * But I still don’t get how the code ended in the php file in the first place…
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [10 years ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376509)
 * > However, after adding it in the right place as suggested by the theme developer
 *     ```
       <html <?php language_attributes(); ?> <?php do_action( 'add_head_attributes' ); ?>>
       ```
   
 * **That’s incorrect**. That action is to add Schema markup for the HEAD section,
   and applies only to Schema markup in the HEAD section (not the HTML document 
   as a whole). If you use the WPSSO JSON extension, you can remove the ‘add_head_attributes’
   action completely as it’s not necessary anymore (WPSSO JSON disables the Schema
   meta tags in favor of Schema JSON markup instead, which is much better).
 * The rel=”author” and itemprop=”description” would come from your theme or another
   plugin. You can sometimes tell by their placement in the head section — if they’re
   near the top, it’s most likely your theme, and lower down would be a plugin (
   hooked to the wp_head filter).
 * js.
 *  Thread Starter [overkill22](https://wordpress.org/support/users/overkill22/)
 * (@overkill22)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376528)
 * I think I found what went wrong with the code.
    The WPSSO plugin is asking me
   now to update the header adding the line by inserting manually `<head <?php do_action('
   add_head_attributes' ); ?>>` or updating automatically by the plugin.
 * Is this a bug?
 * [LINK TO THE SCREENSHOT](http://i.imgur.com/jPUSBWM.jpg)
 *  Plugin Author [JS Morisset](https://wordpress.org/support/users/jsmoriss/)
 * (@jsmoriss)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376529)
 * This is correct. The head attributes should be added to the `<head>` HTML tag,
   not the `<html>` HTML tag (as you appear to have it in your header template).
 * js.
 *  Thread Starter [overkill22](https://wordpress.org/support/users/overkill22/)
 * (@overkill22)
 * [9 years, 12 months ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376530)
 * Alright.
    I think I’ll ignore the message and don’t add the code since it is 
   giving me the errors. I’ll try to tell the theme developer about this, since 
   for what I understood it is a theme problem.
 * Again, thank you for your patience.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Structured Data Testing Error’ is closed to new replies.

 * ![](https://ps.w.org/wpsso/assets/icon-256x256.png?rev=3167695)
 * [WPSSO Core - Complete Schema Markup and Meta Tags](https://wordpress.org/plugins/wpsso/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpsso/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpsso/)
 * [Active Topics](https://wordpress.org/support/plugin/wpsso/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpsso/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpsso/reviews/)

 * 7 replies
 * 2 participants
 * Last reply from: [overkill22](https://wordpress.org/support/users/overkill22/)
 * Last activity: [9 years, 12 months ago](https://wordpress.org/support/topic/structured-data-testing-error/#post-7376530)
 * Status: resolved