Are you looking to add title attributes to your WordPress navigation menu items?

The title attribute allows you to provide extra information about a menu item. It often appears as tooltip text when a user’s mouse moves over the link.

In this article, we will show you how to add title attributes in WordPress navigation menus for both classic themes and block themes.

How to Add Title Attribute in WordPress Navigation Menus

Why Add Title Attributes to Navigation Menu Items?

In WordPress, you can add a title attribute to better describe any HTML element. This is often used with links and images to provide extra information that appears as a tooltip when the user hovers their mouse over the element.

Here’s an example of an image title attribute displayed in a tooltip. The user can learn more information about the image by moving their mouse over it.

An image with the title text

You can learn more in our guide on the difference between image alt text vs. title.

We also recommend you use the title attribute when adding links to your post. This allows users to see where the link will take them before they click it.

Some SEO experts believe that the link attribute is useful for search engine optimization (SEO) because it allows you to provide more context.

The title attribute may also be read out loud by screen readers that are used by visually impaired users. However, it is often ignored, and the anchor text is read instead.

With that being said, let’s take a look at how to add the title attribute in WordPress navigation menus. You can use the links below to jump to the method that works with your theme:

If you are using a classic WordPress theme, then you can customize your navigation menu by visiting Appearance » Menus in your dashboard.

However, you are not able to add a title attribute to menu entries by default.

To add this capability, you will need to click the ‘Screen Options‘ tab in the top right corner of the screen. This will bring down a menu, where you need to click on the check box next to the ‘Title Attribute’ option.

Enabling Image Attributes in Screen Options

This will add a title attribute field for when you create or edit a menu entry.

Now, you can scroll down and click on any menu item in your existing menu to expand it. You will see the title attribute field.

Adding a Title Attribute to a Classic Theme Menu Item

You can now add the text you want to use as a title. You can also expand other menu items and add title attributes to them.

Don’t forget to click on the ‘Save Menu’ button at the bottom of the page to store your changes.

You can now visit your WordPress website and take your mouse over a link in the navigation menu. You will see the title attribute displayed as a tooltip.

Preview of a Menu Entry Title Attribute When Using a Classic Theme

If you are using a block theme, then you can customize your navigation menu using the Full Site Editor. This editor allows you to add title attributes to your menu entries by default.

First, you need to navigate to Appearance » Editor in your WordPress admin area and then click on the ‘Navigation’ option to find your menus.

Go to the Navigation Section of the Full Site Editor and Select a Menu

You will need to select the menu you wish to edit from the list.

Now, you can click the preview pane on the left to open the editor full screen. Make sure you can see the settings pane on the left. If not, then you can display it by clicking the ‘Settings’ button at the top of the screen.

Click a Menu Entry in the Settings Pane

Next, click the menu item in the settings pane that you wish to edit. This will display the options for that entry, including the title attribute.

Simply type your title into the ‘Title Attribute’ field.

Add a Tiitle Attribute in the Settings Pane

Make sure you click the ‘Save’ button at the top of the screen to store the new settings. You will need to click a second ‘Save’ button to confirm.

Now, you can visit your website to see the menu title attribute in action.

Preview of a Menu Entry Title Attribute in a Block Theme

Now that you know how to add a title attribute in your navigation menu, you may like to see some other articles related to customizing the WordPress navigation menu:

We hope this tutorial helped you learn how to add a title attribute in WordPress navigation menus. You may also want to see our guide on how to increase your blog traffic or our expert pick of the best contact form plugins for WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


source

Categorized in: