Fix guides · Accessibility
How to fix “Some elements have a tabindex value greater than 0”
Positive tabindex values force a custom tab order that skips around the page and confuses keyboard users. How to remove them, and why duplicate accesskeys cause similar trouble.
- Time to fix
- 10–30 minutes
- Skill needed
- Developer
- Who notices
- Keyboard users
Why it matters
Keyboard users move through a page with Tab, in the order elements appear in the code. tabindex="1" (or any number above 0) pulls an element to the front of that order, so focus jumps unexpectedly and then has to work back through everything else.
accesskey attributes assign keyboard shortcuts. Two elements with the same key, or keys that clash with browser and screen reader shortcuts, make them unpredictable.
“Of all websites using the tabindex attribute, 4% employ positive values (down from 7% in 2022).”
Before you start
- Use only tabindex="0" (to make a custom control focusable) or tabindex="-1" (to focus something from a script). Remove anything higher.
- If the order is wrong without it, change the order of elements in the code instead, so it matches what people see.
- Remove duplicate accesskey values; most sites are better off with no accesskeys at all.
Fix it on your platform
Shopify
- Shopify's theme accessibility guidance says themes should use no tabindex values other than 0 or -1, and no autofocus.
- Fix it in Edit code (search your theme for tabindex), or ask your theme developer. If an app's widget is listed, contact its developer.
WordPress
- Search your theme and custom HTML blocks for tabindex. If a plugin outputs it, update the plugin or contact its developer.
Webflow
- Check Element settings → Custom attributes for a tabindex above 0 and remove it. Reorder elements in the Navigator if the order needs to change.
Wix Managed by the platform
- Wix controls tab order through the page's DOM order, which you can check and adjust in the Layers panel or the Accessibility Wizard. If custom code adds tabindex, remove it.
Squarespace Managed by the platform
- Squarespace sets tab order for its own elements. If code injection or a code block adds tabindex or accesskey, remove it.
Next.js
- Remove positive tabIndex props and reorder the JSX instead.
Any other site
- Replace positive tabindex values with 0, or remove them and reorder the HTML.
<!-- Before -->
<a href="/sale" tabindex="1">Sale</a>
<!-- After -->
<a href="/sale">Sale</a>Check that it's fixed
- Press Tab from the top of the page: focus should move in reading order, top to bottom and left to right.
- Re-run your StudioLNC audit: the issue should be gone.
Find every issue like this on your site
Free audit of performance, accessibility, SEO and security, with fixes for your platform.