Do not sell my personal information – BUTTON
<a style=”color:#333333″ class=”wt-cli-ccpa-opt-out”>
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
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.