Use the accesskey in your WordPress site can have some advantages, especially if your business has to do in some way with disabled users or who use assistive technologies, that is special tools to be able to browse the web and use the computer.
Entering access keys is still useful for all websites, since it is an improvement in accessibility and therefore is also an important signal for the SEO of your site.
But let’s see what it is and how to use it.
What are accesskeys
The accesskey they are key combinations that allow a user to perform an operation, including opening a link, without having to use the mouse. They are also called hotkeys, keyboard shortcuts or hotkeys.
Have you ever used the combination CTRL + C and CTRL + V to copy and paste a file or folder on your computer? This is exactly how accesskeys work.
It is in fact possible to assign key combinations to the menu items of your site or to any other link, so, for example, to open the home it will be sufficient to press the ALT + H keys, to go to the services page ALT + S, for the blog ALT + B and so on.
How to enter accesskeys on a WordPress site
An accesskey is inserted by adding the attribute to the link accesskey followed by the letter you want to use as a hot key. It will be activated by typing this letter in combination with the alt, shift or control key of the keyboard (depends on the browser and the operating system).
For simplicity, we use the first letter of the link you want to open, then H for the Home, C for the About page, P for Products and so on. Use the second letter if the first has already been assigned to another link (Contacts will then have the letter O).
Unfortunately, there are currently no WordPress plugins that allow you to insert this function quickly and easily.
Also, modifying the code that displays the navigation menu of a WordPress site is quite a complex operation and you will need to get help from an experienced developer.
It is much easier, however, to operate on the links present within the content and in the sidebar or footer widgets, so here it is what to do if you can’t add accesskeys to your menu:
- Insert a list of menu pages inside the sidebar, using a Text widget.
- Create a link for each item in the list that leads to the correct page.
- Select the tab Text to be able to edit the widget HTML code.
- Inside the tag , after the page url and before the> symbol, insert the code accesskey = ”x”, replacing the X in the example with the letter you want to use as a hotkey.
Now that you’ve created the links, test to see if everything is working properly.
The access keys are used differently depending on the browser and operating system you use to navigate.
On Windows, you have to use the accesskey together with the keys:
Firefox: shift + alt
Internet Explorer: alt
Opera: (from version 15 up) alt; (earlier versions) shift + esc
On Mac, use the accesskey together with the keys:
Chrome: control + alt
Firefox: control + alt
Safari: control + alt
Example: to open the home page according to the setting of the image above, using Windows and the Chrome browser, simply press the ALT + H keys together.
Who needs accesskeys
As I mentioned at the beginning, accesskeys are useful on any website. First of all, because they are an important signal for Google, which will see your commitment in structuring an accessible website and therefore will reward you.
Second, you will provide a service of particular importance to all people who use assistive technologies. The blind and people with reduced mobility, for example, can use the accesskey to open the page they need, without having to scroll through all the links or use the mouse.
Third, if you manage the site of a public body or a company operating in the public sector, you will comply with the requirements imposed by law for this type of website.
Using accesskeys on your website can have many advantages, but it’s not super easy if you don’t have programming knowledge. You can still work in a simple way on the code by following the procedure I described to you.
You can find more information on this topic in the W3Schools HTML accesskey attribute page.
Why do you plan to use accesskeys on your site?
If you have any questions about using this feature, drop us a comment!