Links
Warning

Empty or Invalid href Attribute

This error appears when there are links with an empty or invalid href attribute that doesn't point to any real destination. Here's what it means and how to fix it.

What this error means

The href attribute is what defines a link's destination. When it's empty, contains just a #, a javascript:void(0), or a simple ., the link exists in the code but doesn't lead anywhere specific. For the user it's a link that doesn't work as expected, and for Google it's a signal that contributes nothing. These kinds of values are often used as a quick fix during development, when it's not yet known where the link will point. The problem is when they make it to production without being resolved. There is one case where it can make sense to keep it, and that's in multi-level navigation menus where the parent element only serves to expand the options and doesn't point to any specific page. In that specific context it's acceptable, as long as its function is correctly indicated for screen readers. Outside of that case, a link with an empty or invalid href is an error worth fixing as soon as possible.

Why fixing empty or invalid hrefs matters

A link that doesn't lead anywhere contributes nothing — not to your visitors, not to Google. And if there are several, the impression is of a half-finished site. Fixing them improves navigation, accessibility, and the signals Google receives about your site's structure.

Impact on SEO rankings

Google follows links to crawl and index your site's content. A link with an empty or invalid href doesn't lead to any page, so it provides no SEO value and doesn't contribute to distributing authority across your pages.

Impact on user experience

A user who clicks a link that doesn't work loses trust in your site. They don't know whether it's an error or whether the content doesn't exist, and that creates frustration and may cause them to leave early.

Negative signals for site quality

For Google, having links with empty or invalid hrefs in production signals that the code wasn't reviewed before publishing. These kinds of technical oversights form part of the overall assessment of your site's quality.

How to fix it step by step

If this error showed up in your audit, here are the steps to leave it behind.

Step 1

Identify which links have an empty or invalid href

Ruk Audit shows you exactly which links have this problem and what the visible text of each one is. Review them before editing anything and prioritize those on the most important pages.

Step 2

Decide what each link should do

Before fixing, understand what that link was intended to do. Should it point to a specific page? Was it a navigation element pending completion? Or is it an interactive element that doesn't need to point to any URL?

Step 3

Apply the fix based on the case

If the link should point to a page, replace the href with the correct URL. If the element is interactive and doesn't need to navigate anywhere, replace the link tag with a button. If it's the parent element of a dropdown menu that only serves to expand options, keep the link but add role="button" to correctly indicate its function to screen readers.

Step 4

Verify that no link has been left unfixed

Once the changes are made, check that all links have a valid href or have been replaced with the correct element. Pay special attention to navigation menus and interactive elements.

Does your site have this problem?

Audit your website for free and discover if this and other SEO errors are affecting your ranking.

Get a free audit. Over 2501 reports delivered.
Hey, wait a moment
To analyze a website, you first need to create an account in the application. Click the button below to go to the registration screen.
Create account