Published on
Dec 17, 2024
Updated on
Dec 31, 2024
Share

Add a link in a new tab with the "Custom Link Menu New Tab" module

In a WordPress site, it often happens that certain links in the navigation menu need to open in a new tab. However, WordPress doesn't offer a simple, visible interface for managing this behavior directly from the menu settings. That's why we've developed the Custom Link Menu New Tab from WPMasterToolKit. This module adds a practical option for configuring the opening of custom links in a new tab, while automatically adding attributes such as rel="noopener noreferrer nofollow"This enhances both the user experience and safety.

Which plugin can the "Custom Link Menu New Tab" module replace?

This module can easily replace dedicated plugins such as "External Links in New Window / New Tab or other similar extensions that add functionality for opening links in a new tab for menus.

Discover the module : Open all external links in a new tab

Simplified management of personalized links

With the Custom Link Menu New Tabusers now have precise control over the opening of custom links in menus. Here's how it works:

  1. Checkbox added to menu parameters A new checkbox appears in the menu item editing options (only available for custom links).
  2. Save selected option If this option is enabled, it will be saved for this specific menu link.
  3. Automatic addition of attributes When the box is checked, the attributes target="_blank" and rel="noopener noreferrer nofollow" are automatically added to the link, guaranteeing greater security and SEO compliance.

How do I use the "Custom Link Menu New Tab" module?

  1. Activate the Custom Link Menu New Tab from the WPMasterToolKit parameters.
  2. Go to Appearance > Menus in the WordPress dashboard.
  3. Add or modify a personalized link in your menu.
  4. In the element parameters, a new checkbox entitled "Open link in new tab and add rel='noopener noreferrer nofollow' " will appear. Check it if you want the link to open in a new tab.
  5. Save the menu to apply the changes.
WordPress menu management interface

The module does all the work in the background: it saves your choice and automatically applies the necessary attributes.

Technical choices behind the module

Optimized performance

In keeping with the WPMasterToolKit philosophy, we've designed this module so that it doesn't load no unnecessary resources. If the module is not activated, it is not loaded into WordPress, which limits its impact on your site's overall performance.

Using WordPress filters and actions

We used native WordPress hooks to ensure maximum compatibility with other extensions and themes:

  • wp_nav_menu_item_custom_fields This filter allows us to add the checkbox directly to the menu item parameters.
  • wp_update_nav_menu_item This action saves the value of the checkbox when the menu is saved.
  • nav_menu_link_attributes This filter is used to automatically add the attributes target="_blank" and rel="noopener noreferrer nofollow" to the relevant custom links.

Enhanced safety

Attributes rel="noopener noreferrer nofollow" automatically added protect your site from potential vulnerabilities linked to external links opened in a new tab, while respecting SEO best practices.

Pro
from
2.50$
/Month
14
Days
Money-back guarantee
risk-free at 100 %!

Conclusion

The module Custom Link Menu New Tab is a simple yet powerful solution for managing links in WordPress menus. Whether you're looking to enhance the user experience or strengthen your site's security and SEO, this module is designed to meet your needs while being lightweight and easy to use. By activating this module via WPMasterToolKit, you can say goodbye to additional plugins while retaining total control over your menus.

Category
Contents & Media
Version
≤ 1.0.0
Type
Free
More than 18 reviews
+1000
Installations
104
Modules
Pro
from
30.00$
/Year