• Hi,

    I have error in Google SEO rating on Google speed insights see screen: on your button you don’t have title attribute needed:

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter Djordje – George – Giorgio

    (@djondesigns)

    Do not sell my personal information – BUTTON

    <a style=”color:#333333″ class=”wt-cli-ccpa-opt-out”>

    Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi @djondesigns,

    Greetings from CookieYes!

    Please share a screenshot of the error.

    Link does not have title attribute – prodeuces error on google insights for SEO

    Plugin Support CookieYes Team

    (@cookieyesteam)

    Hi @djondesigns,

    Please try the below code snippet to fix this issue.

    add_action('wp_head', 'wt_cli_add_href_to_links', 1);
    function wt_cli_add_href_to_links() {
    if (!class_exists('Cookie_Law_Info')) return;
    ?>
    <script>
    window.addEventListener( 'DOMContentLoaded', addHrefToLinks );
    function addHrefToLinks() {
    var wt_cli_links = document.querySelectorAll( '#cookie-law-info-bar a, #cliSettingsPopup a' );
    wt_cli_links.forEach( el => {
    if(!el.hasAttribute('href'))
    el.href = "#";
    });
    }
    </script>
    <?php
    }

    Correct code snippet – inside functions.php file is:

    add_action('wp_head', 'wt_cli_add_href_to_links', 1);
    function wt_cli_add_href_to_links() {
    if (!class_exists('Cookie_Law_Info')) return;
    $script = '<script>
    window.addEventListener( "DOMContentLoaded", addHrefToLinks );
    function addHrefToLinks() {
    var wt_cli_links = document.querySelectorAll( "#cookie-law-info-bar a, #cliSettingsPopup a" );
    wt_cli_links.forEach( el => {
    if(!el.hasAttribute("href"))
    el.href = "#";
    });
    }';
    $script .= '</script>';
    echo $script;
    }

    Issue solved and marked resolved.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.