
-
AuthorPosts
-
June 11, 2025 at 9:35 pm #1485352
Dear Enfold Support Team,
I’m working on making my website more accessible:
https://www.schlosswirtschaft-schwaige.de
I’m using the built-in search icon in the main menu (top right), enabled via the Enfold settings.
However, accessibility tools (like WAVE) report two problems:
– The search icon has no accessible label (aria-label or similar).
– It’s also flagged as a “suspicious link”.
Could you please tell me the best way to solve this so it meets accessibility standards (WCAG)?
Thank you very much for your help!Best regards, Diana
June 12, 2025 at 6:56 am #1485357Hey Diana,
Thank you for the inquiry.
Looks like you have already added the aria-label attribute to the search icon link. Is this still an issue?
< li id="menu-item-search" class="noMobile menu-item menu-item-search-dropdown menu-item-avia-special" role="menuitem"><a class="avia-svg-icon avia-font-svg_entypo-fontello" <strong>aria-label="Suche"</strong> href="?s=" rel="nofollow" >
Best regards,
IsmaelJune 13, 2025 at 2:22 am #1485394Dear Ismael,
Unfortunately, the issue still persists. Firstly, I can’t find the code you mentioned. Also, I tested the element again, and WAVE still shows multiple errors:The main issue is that “the link text is not understood” – for example:
.
This single issue seems to trigger additional errors such as “Suspicious link text” and “Redundant link”.
Best regards DianaJune 13, 2025 at 7:50 am #1485406Hi,
Thank you for the update.
What happens when you edit line 120 of the enfold\includes\config-enfold\functions-enfold.php file?
$icon = avia_font_manager::get_frontend_icon( 'svg__search', false, [ 'aria-hidden' => 'true', 'title' => $title, 'desc' => $title ] );
Try to set aria-hidden to false:
$icon = avia_font_manager::get_frontend_icon( 'svg__search', false, [ 'aria-hidden' => 'false', 'title' => $title, 'desc' => $title ] );
Or remove the attributes completely.
$icon = avia_font_manager::get_frontend_icon( 'svg__search', false, [ ] );
Let us know the result.
Best regards,
IsmaelJune 14, 2025 at 12:53 am #1485452Dear Ismael,
Thank you for your response. I appreciate your support.
However, I believe there may have been a misunderstanding regarding the issue. The problem is not with the icon itself or its aria-hidden attribute, but with the structure and function of the link that wraps the icon.
Accessibility tools such as WAVE still flag this element because: The link href=”?s=” does not lead to meaningful content.
It is interpreted as a broken or contextless link (“suspicious link text”), since it doesn’t visibly describe its purpose and doesn’t lead to a proper search page.If the only way to resolve this is by modifying core theme files, I’m afraid I won’t proceed with that, as any such changes would be lost with the next theme update.
Is there any other way?Best regards,
Diana-
This reply was modified 2 weeks, 6 days ago by
DianaLoola73.
June 14, 2025 at 8:25 pm #1485459Hi,
I have researched this and while there is a long technical explanation for why the WAVE test tool is flagging this, I found a solution in my research. Try adding this code to the end of your child theme functions.php file in Appearance ▸ Editor:function remove_link_from_search_icon_and_add_it_back_on_click() { ?> <script> document.addEventListener('DOMContentLoaded', function() { const searchLink = document.querySelector('#menu-item-search a'); if (searchLink) { // Store the original href const originalHref = searchLink.getAttribute('href'); // Remove the href on page load searchLink.removeAttribute('href'); // Add click event to restore href searchLink.addEventListener('click', function() { if (!searchLink.getAttribute('href')) { searchLink.setAttribute('href', originalHref); } }); } }); </script> <?php } add_action( 'wp_footer', 'remove_link_from_search_icon_and_add_it_back_on_click', 99 );
If you are not using a child theme you could use the WP Code plugin then add a new snippet, in the top right corner use the PHP snippet as the code type:
and ensure that it is activated, then add the above code and save.
I tested this on the WAVE Web Accessibility Evaluation Tool and it removed the error.Best regards,
MikeJune 17, 2025 at 10:25 am #1485564by the way – it is nice to have an embedded tab navigation now on Enfold – but to prevent that mouse events do show the focus setting – it might be better to go to the focus-visible or focus-within setting. These rulesets do not influence the click or hover states of links / buttons etc.
f.e. :
#menu-item-search a.avia-svg-icon:focus { outline: none !important; } #menu-item-search a.avia-svg-icon:focus-visible > svg { outline: 3px solid red !important; outline-offset: 5px; }
now we got the ugly outline by navigation with mouse !
you can see here a manually set tab navigation with only focus-visible settings. Click a link to see that the states are not influenced.
https://guenterweber.com/June 18, 2025 at 7:37 am #1485615Hi,
However, I believe there may have been a misunderstanding regarding the issue. The problem is not with the icon itself or its aria-hidden attribute, but with the structure and function of the link that wraps the icon.
If we’re not mistaken, the issue occurs because the SVG icon includes the aria-hidden attribute, which makes it unreadable to accessibility tools. As a result, the parent link is marked as “suspicious” since the icon is hidden and the link lacks any accessible text or description. The span avia_hidden_link_text, which contains the word “Search” also has its display property set to none, making it inaccessible to screen readers as well.
Removing the aria-hidden attribute from the SVG icon or adjusting the visibility of the avia_hidden_link_text should help.
#top .avia_hidden_link_text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
You can also try editing the enfold/includes/config-enfold/functions-enfold.php, around line 125, change the text “Search” to “Click here to search”.
$items .= '<span class="avia_hidden_link_text">' . __( 'Click Here to Search', 'avia_framework' ) . '</span>';
According to https://wave.webaim.org/, screen readers tend to better interpret buttons or links when it contains more descriptive text.
If this doesn’t help, you can always try the suggestions above.
Let us know the result.
Best regards,
IsmaelJune 26, 2025 at 8:34 pm #1485977Dear Ismael, dear Guenni007,
Thank you very much for your detailed support and for taking the time to look into the accessibility issue regarding the search icon …
We truly appreciate all the suggestions and the effort you put into providing possible solutions. Also thanks to Günter for stepping in and offering further technical advice.
In the end, the client decided to go with the simplest approach and asked me to remove the search icon entirely from the menu to avoid any further complications. So, with this solution, the issue is resolved from our side.Best regards,
DianaJune 26, 2025 at 10:25 pm #1485980Hi,
Glad Guenni007 could help, thank you Guenni007, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
This reply was modified 2 weeks, 6 days ago by
-
AuthorPosts
- The topic ‘Accessibility Issue with Search Icon’ is closed to new replies.