• Resolved overkill22

    (@overkill22)


    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://www.ads-software.com/plugins/wpsso/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author JS Morisset

    (@jsmoriss)

    No, not at all. A typical header.php file would include the following (as an example):

    <!DOCTYPE html>
    <html xmlns="https://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

    (@overkill22)

    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
    3. link three

    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‘s a link to a page of my website.

    Thanks for your time

    Thread Starter overkill22

    (@overkill22)

    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: https://ogp.me/ns# fb: https://ogp.me/ns/fb# article: https://ogp.me/ns/article#" itemscope itemtype="https://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

    (@jsmoriss)

    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

    (@overkill22)

    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

    Plugin Author JS Morisset

    (@jsmoriss)

    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

    (@overkill22)

    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.