{"id":18366401,"date":"2025-03-17T19:45:09","date_gmt":"2025-03-17T19:45:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/wrong-href-syntax\/"},"modified":"2025-03-17T19:45:09","modified_gmt":"2025-03-17T19:45:09","slug":"wrong-href-syntax","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/wrong-href-syntax\/","title":{"rendered":"Wrong href syntax"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Hello everyone,<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m using the Cookie Notice &amp; Compliance for GDPR\/CCPA plugin and have encountered an accessibility issue related to the markup generated by the plugin.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Description of the problem:<\/strong><br \/>The accessibility analyzer reports errors with the use of links for actions that do not involve navigation. Specifically, the following errors appear:<\/p>\n\n\n\n<ul>\n<li><strong>Issue ID 146:<\/strong> htmlCopiarEditar<code>&lt;a href=\"#\" id=\"cn-accept-cookie\" data-cookie-set=\"accept\" class=\"cn-set-cookie cn-button\" aria-label=\"Aceptar\" style=\"background-color: #adadad\"&gt;Aceptar&lt;\/a&gt;<\/code><\/li>\n\n\n\n<li><strong>Issue ID 147:<\/strong> htmlCopiarEditar<code>&lt;a href=\"#\" id=\"cn-refuse-cookie\" data-cookie-set=\"refuse\" class=\"cn-set-cookie cn-button\" aria-label=\"Rechazar\" style=\"background-color: #adadad\"&gt;Rechazar&lt;\/a&gt;<\/code><\/li>\n\n\n\n<li><strong>Issue ID 148:<\/strong> htmlCopiarEditar<code>&lt;a href=\"#\" class=\"cn-revoke-cookie cn-button\" aria-label=\"Revocar\" style=\"background-color: #adadad\"&gt;Revocar&lt;\/a&gt;<\/code><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The issue is that <code>&lt;a&gt;<\/code> tags with <code>href=\"#\"<\/code> are being used for actions (accepting, rejecting, and revoking cookies), which is not semantically correct. According to accessibility best practices, elements that trigger actions should be buttons (<code>&lt;button&gt;<\/code>) instead of links, since <code>&lt;a&gt;<\/code> tags are meant for navigation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>My question:<\/strong><br \/>Is there any way to modify or override the markup generated by the plugin to resolve this issue? I haven&#8217;t found any documentation on the matter. I would like to know if there is a hook, filter, or any method to customize the HTML (for example, changing <code>&lt;a&gt;<\/code> to <code>&lt;button&gt;<\/code>) so that it complies with accessibility recommendations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Thank you in advance for any suggestions or solutions you might offer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Regards,<br \/>Dar\u00edo G\u00f3mez Gonz\u00e1lez<\/p>\n","protected":false},"template":"","class_list":["post-18366401","topic","type-topic","status-publish","hentry","topic-tag-href"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18366401","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/18366401\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=18366401"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}