-
Duplicate navigation menus hidden via CSS – SEO impact?
Hey! I'm just a react dev dealing with a technical SEO question that I'd love your input on.
I'm working on a Next.js SSG (Static Site Generation) website with multiple client components. I have a complex responsive navigation that has completely different structures for mobile vs desktop:
-
Desktop: Horizontal menu with dropdowns, different buttons, language dropdown
-
Mobile: Hamburger menu with accordion-style menus, different button layout and different language dropdown
Currently using JavaScript hook to detect breakpoints. It causes hydration mismatch errors because the server renders version for mobile but the client on desktop shows another based on screen size.
So I am thinking about solution: Rendering BOTH navigation structures in the HTML and use CSS media queries to hide the inappropriate one:
<nav> <div class="nav-desktop"><!-- Desktop navigation --></div> <div class="nav-mobile"><!-- Mobile navigation --></div> </nav> @media (max-width: 1279px) { .nav-desktop { display: none; } } @media (min-width: 1280px) { .nav-mobile { display: none; } }
SEO Concerns:
- Duplicate content: Both navs contain the same links – will this be seen as keyword stuffing or will it cause problem with internal linking?
- Hidden content: Google's guidelines say hidden content may be devalued – does CSS display: none count?
- Will Googlebot be concerned parsing duplicate navigation?
Any insights from your experience would be hugely appreciated! Thanks!
-
Log in to reply.