Skip to main content
How to Hide Menu Items on Desktop or Mobile Devices

Learn how to customize your Divi built-in navigation to control which menu items appear based on the device being used.

Updated over 4 months ago

Customizing your website's navigation menu to display different items on desktop and mobile devices can significantly improve user experience and streamline navigation.

In this article, we will guide you through the process of hiding specific menu items on either desktop or mobile devices using Divi.

  1. Go to WordPress Dashboard → Appearance → Menus

  2. Click on the Screen Options button at the top right corner

  3. Ensure that the CSS Classes checkbox is checked

  4. Edit the menu item you want to hide, and in the CSS classes field, use one of the following CSS classes:

    1. dt-hide-on-desktop - to hide the menu item on the desktop

    2. dt-hide-on-tablet - to hide the menu item on the tablet

    3. dt-hide-on-phone - to hide the menu item on the phone

  5. Go to WordPress Dashboard → Divi → Theme Options → General Tab → Custom CSS

  6. Copy/Paste the following CSS code:

    /* Hide Menu item on Desktop */
    @media (min-width: 981px) {
    .dt-hide-on-desktop {
    display: none !important;
    }
    }

    /* Hide Menu item on Tablet */
    @media (min-width: 768px) and (max-width: 980px) {
    .dt-hide-on-tablet {
    display: none !important;
    }
    }

    /* Hide Menu item on Phone */
    @media (max-width: 767px) {
    .dt-hide-on-phone {
    display: none !important;
    }
    }

Pro Tip: If you don't want a particular menu item to display on the desktop and the tablet, you can use both of the classes separated by a space: dt-hide-on-desktop dt-hide-on-tablet

Did this answer your question?