Archived topic
Links are not crawlable in GP mega menu (Child Item)
7 replies · Started by Santi on July 13, 2022
Hi!
I'm using the generatepress mega menu (https://docs.generatepress.com/article/building-simple-mega-menu/) and my child item it's not supposed to be a link, but to act like heading or paragraph.
What I have at the moment is a custom link with "#". And when I analyze the page in web.dev it appears that the links are not crawlable.
Thanks
Hi there,
when i inspect your site the sub menu titles ie. Por tipo are empty anchors ie. <a>Por tipo</a>
There is no href - can you confirm you have a # in those menu items URL field ?
Hi David,
Yes! I deleted for a moment the "#" but now you will see the <a href="#">
If re-run the lighthouse audit then i now see less <a> - so the error has passed for the ones you added the # href to.
Can you do the rest ?
Ok now the lighthouse scores 100, it was some slideout menu links, so the problem is solved. I'm sorry for wasting your time in this stupid problem.
Taking advantage of this topic, is there any css option to disable the hover on those "links" (only on desktop)? I mean, when I'm pointing on any Grandchild item, the child item hovers too.
No apologies necessary - happy to be of help.
Try this CSS to make those 'links' unclickable:
@media(min-width: 769px) {
.mega-menu .sub-menu > li > a[href="#"] {
pointer-events: none;
}
}
Thanks David! It worked. Have a nice day :)
Glad to be of help :)